bpy.image['name'].pixels[0] shows wrong value #61977

Closed
opened 2019-02-26 13:57:40 +01:00 by evgenvasilev · 5 comments

System Information
Operating system: ubuntu 18.04

Blender Version
Broken: 2.79b

Short description of error
Same image saved with different depths has different values printed with bpy.image['name'].pixels- [x] (much more than could be caused with changing depth).

Exact steps for others to reproduce the error

  1. open attached test.blend
  2. paste to console:
  bpy.image['test8.png'].pixels[0]
  bpy.image['test16.png'].pixels[0]
  1. notice that output is 0.7372549176216125 and 0.5000087022781372 respectively, but images don't differ so much
    test.blend test8.png test16.png
    Don't worry if you don't notice images, their size is 1x1
**System Information** Operating system: ubuntu 18.04 **Blender Version** Broken: 2.79b **Short description of error** Same image saved with different depths has different values printed with bpy.image['name'].pixels- [x] (much more than could be caused with changing depth). **Exact steps for others to reproduce the error** 1. open attached test.blend 2. paste to console: ``` bpy.image['test8.png'].pixels[0] bpy.image['test16.png'].pixels[0] ``` 3. notice that output is 0.7372549176216125 and 0.5000087022781372 respectively, but images don't differ so much [test.blend](https://archive.blender.org/developer/F6717188/test.blend) ![test8.png](https://archive.blender.org/developer/F6717199/test8.png) ![test16.png](https://archive.blender.org/developer/F6717205/test16.png) Don't worry if you don't notice images, their size is 1x1
Author

Added subscriber: @nthyjrn

Added subscriber: @nthyjrn

Added subscribers: @brecht, @ZedDB

Added subscribers: @brecht, @ZedDB

I can confirm this on 2.8 too.

You will get the same value if you change the color management setting to Raw.

@brecht Does this fall in with #54659 as the rest of the 16bit problems?

I can confirm this on 2.8 too. You will get the same value if you change the color management setting to Raw. @brecht Does this fall in with #54659 as the rest of the 16bit problems?

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Brecht Van Lommel self-assigned this 2019-02-27 19:44:52 +01:00

It's not really related to that. It's a weirdness in the API which we should improve once, but outside the scope of the bug tracker.

Blender loads 8-bit images in a byte buffer to keep memory low, without color space conversion. Higher bit depth images are always converted to scene linear color space in a float buffer.

So what you have are pixels in two different color spaces. image.is_float can be used to detect which type of image it is.

It's not really related to that. It's a weirdness in the API which we should improve once, but outside the scope of the bug tracker. Blender loads 8-bit images in a byte buffer to keep memory low, without color space conversion. Higher bit depth images are always converted to scene linear color space in a float buffer. So what you have are pixels in two different color spaces. `image.is_float` can be used to detect which type of image it is.
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
3 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#61977
No description provided.