Single channel byte image takes same amount of memory in Cycles as multi channel image (GPU and CPU) #49613

Closed
opened 2016-10-09 17:57:30 +02:00 by David Ullmann · 24 comments

System Information
Windows 10 64bit, Geforce GTX970 (driver 373.06)

Blender Version
Broken: 2.78

Short description of error
As the title says. 2k image textures (rgb and single channel version) are provided and packed in the blend file.
Cycles should display less memory usage according to 3c85e1ca1a when using the grayscale version

Exact steps for others to reproduce the error
Rendering scene with rgb texture:
Single channel test RGB.png

Taking same amount of memory when rendering with grayscale texture:
Single channel test GRAYSCALE.png

Single channel test.blend

Note: Maybe packing the texture files into the blend changed its' internal format to RGB, however the problem still is there with the original external files:

Thanks in advance!

**System Information** Windows 10 64bit, Geforce GTX970 (driver 373.06) **Blender Version** Broken: 2.78 **Short description of error** As the title says. 2k image textures (rgb and single channel version) are provided and packed in the blend file. Cycles should display less memory usage according to 3c85e1ca1a when using the grayscale version **Exact steps for others to reproduce the error** Rendering scene with rgb texture: ![Single channel test RGB.png](https://archive.blender.org/developer/F376011/Single_channel_test_RGB.png) Taking same amount of memory when rendering with grayscale texture: ![Single channel test GRAYSCALE.png](https://archive.blender.org/developer/F376015/Single_channel_test_GRAYSCALE.png) [Single channel test.blend](https://archive.blender.org/developer/F376020/Single_channel_test.blend) Note: Maybe packing the texture files into the blend changed its' internal format to RGB, however the problem still is there with the original external files: Thanks in advance!
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @DavidUllmann

Added subscriber: @DavidUllmann

Added subscriber: @intracube

Added subscriber: @intracube

I'm seeing similar behaviour on 2.78 (linux), but only for packed images. Files referenced from disk use less memory as long as they're true single channel. I'm not seeing any memory savings on GPU though - packed or unpacked.

  • RAM usage with 3840x2160 PNG-

(for unpacked image)

single channel PNG:
CPU 9MB
GPU 32MB

RGB PNG:
CPU 32MB
GPU 32MB

(for packed image)

single channel PNG:
CPU 32MB
GPU 32MB

RGB PNG:
CPU 32MB
GPU 32MB

I'm seeing similar behaviour on 2.78 (linux), but only for packed images. Files referenced from disk use less memory as long as they're true single channel. I'm not seeing any memory savings on GPU though - packed or unpacked. - RAM usage with 3840x2160 PNG- (for unpacked image) single channel PNG: CPU 9MB GPU 32MB RGB PNG: CPU 32MB GPU 32MB (for packed image) single channel PNG: CPU 32MB GPU 32MB RGB PNG: CPU 32MB GPU 32MB

Added subscriber: @Sergey

Added subscriber: @Sergey

Packed images are always RGBA. This is a known limitation.

If i unpack the images from provided .blend and convert them to grayscale in Gimp i've got noticeable memory save in render.

So make sure your image is set to grayscale (as in, only stores single channel) and if there's still no memory saving with such file please provide original image file.

Packed images are always RGBA. This is a known limitation. If i unpack the images from provided .blend and convert them to grayscale in Gimp i've got noticeable memory save in render. So make sure your image is set to grayscale (as in, only stores single channel) and if there's still no memory saving with such file please provide original image file.
Author

GRAYSCALE.png this is the original image file.

Makes no defference in memory usage here, regardless of rendering with cpu od gpu.
Tried exporting as grayscale from Blender and again checked in Gimp that it is single channel (which it is definetly).

![GRAYSCALE.png](https://archive.blender.org/developer/F376883/GRAYSCALE.png) this is the original image file. Makes no defference in memory usage here, regardless of rendering with cpu od gpu. Tried exporting as grayscale from Blender and again checked in Gimp that it is single channel (which it is definetly).

With the .blend attached here you need to disable autopack (File -> External Data -> Automatically Pack into .blend). After doing that and opening the new image in shader brings memory usage form 20M to 8M here, Both on Linux and Win7.

Can you confirm that with un-packed image you still have an error?

With the .blend attached here you need to disable autopack (File -> External Data -> Automatically Pack into .blend). After doing that and opening the new image in shader brings memory usage form 20M to 8M here, Both on Linux and Win7. Can you confirm that with un-packed image you still have an error?
Author

Yes, still no change in memory usage here, tested with autopack off.

Yes, still no change in memory usage here, tested with autopack off.

Can you upload the unpacked png that's causing the problem?

Can you upload the unpacked png that's causing the problem?
Author

@intracube see above for the original file :)

@intracube see above for the original file :)

Ah, sorry. Didn't realise the inline image was it.

Still can't reprooduce on linux. GRAYSCALE.png peaks at just over 5MB, converting to RGB 24bit increases it to 17MB.

Ah, sorry. Didn't realise the inline image was it. Still can't reprooduce on linux. GRAYSCALE.png peaks at just over 5MB, converting to RGB 24bit increases it to 17MB.

@DavidUllmann, can you upload exact .blend you use to test memory usage? (make sure you don't hit pack images before uploading :)

@DavidUllmann, can you upload exact .blend you use to test memory usage? (make sure you don't hit pack images before uploading :)
Author

Single channel test.blend here it is, also the original rgb image RGB.png.

Thanks for looking into it :)

[Single channel test.blend](https://archive.blender.org/developer/F377089/Single_channel_test.blend) here it is, also the original rgb image ![RGB.png](https://archive.blender.org/developer/F377090/RGB.png). Thanks for looking into it :)
Author

Also, should the file info in the properties region of the node editor change to something like 'BW' or 'Grayscale' when selecting an image texture node?

Single channel test.png

Also, should the file info in the properties region of the node editor change to something like 'BW' or 'Grayscale' when selecting an image texture node? ![Single channel test.png](https://archive.blender.org/developer/F377097/Single_channel_test.png)

@DavidUllmann, ideally yes but let's keep it outside of this bug report. Will check the file later.

@DavidUllmann, ideally yes but let's keep it outside of this bug report. Will check the file later.

Just to add, I tried the supplied .blend and have got inconsistent results after removing the embedded images. On one attempt, RAM usage didn't decrease for the single channel image. Another attempt seemed to work.

I was also going to mention the incorrect labelling in the image preview...

Just to add, I tried the supplied .blend and have got inconsistent results after removing the embedded images. On one attempt, RAM usage didn't decrease for the single channel image. Another attempt seemed to work. I was also going to mention the incorrect labelling in the image preview...

We need to know exact steps reproducing the issue. Just mentioning that issue happens spontaneously doesn't give any clues about where the issue might be.. it might be in a particular .blend setup..

We need to know exact steps reproducing the issue. Just mentioning that issue happens spontaneously doesn't give any clues about where the issue might be.. it might be in a particular .blend setup..
Author

prepared another blend:

create a plane
subdivide in edit mode and unwrap
apply new material
create 4k color grid texture in uv/image editor
export texture as RGB png -> RGB.png
export another version as BW.png (gimp and irfan view correctly recognize image as grayscale)
load textures in node editor (set 'non color data' in image node) and render...

result: expected memory savings in viewport render and with F12, cpu and gpu.. ~65Mb vs. 16Mb

this is weird... @Sergey any hints why this is not working with the original blend?

Thanks for looking into this btw :)

single channel test 2.blend

RGB.png

BW.png

prepared another blend: create a plane subdivide in edit mode and unwrap apply new material create 4k color grid texture in uv/image editor export texture as RGB png -> RGB.png export another version as BW.png (gimp and irfan view correctly recognize image as grayscale) load textures in node editor (set 'non color data' in image node) and render... result: expected memory savings in viewport render and with F12, cpu and gpu.. ~65Mb vs. 16Mb this is weird... @Sergey any hints why this is not working with the original blend? Thanks for looking into this btw :) [single channel test 2.blend](https://archive.blender.org/developer/F380883/single_channel_test_2.blend) ![RGB.png](https://archive.blender.org/developer/F380884/RGB.png) ![BW.png](https://archive.blender.org/developer/F380886/BW.png)
Author

I think I found the problem: Although I was editing the original file in Photoshop CS5 in grayscale mode, when saving it as PNG, Photoshop creates an RGB image nevertheless... No problem from Blender side here!

I think I found the problem: Although I was editing the original file in Photoshop CS5 in grayscale mode, when saving it as PNG, Photoshop creates an RGB image nevertheless... No problem from Blender side here!

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sergey Sharybin self-assigned this 2016-11-01 11:49:39 +01:00

Considering resolved then :)

Let us know if there's real bug tho.

Considering resolved then :) Let us know if there's real bug tho.

Added subscriber: @bliblubli

Added subscriber: @bliblubli

I would rather close it as todo. There is absolutely no warning in the UI that packed texture will explode the memory usage, even if unpacked afterwards and that an external tool is then needed. Is it really hard to implement single channel packed images that it has to wait for 2.8?

I would rather close it as todo. There is absolutely no warning in the UI that packed texture will explode the memory usage, even if unpacked afterwards and that an external tool is then needed. Is it really hard to implement single channel packed images that it has to wait for 2.8?
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#49613
No description provided.