Brightness/Contrast: Massively incorrect result when using Contrast alone. #35766

Closed
opened 2013-06-15 05:38:37 +02:00 by Adam Friesen · 5 comments

%%%Okay, whoever coded the brightness/contrast node apparently had no idea how the algorithm is supposed to work.

To see the demonstration, render the cube, and watch the screen turn white, the screen turns white because the compositor has it being strung through the brightness/contrast node with the contrast all the way down.

The problem is that when moving the contrast slider alone, Blender ends up doing nothing more than a dumb mix with white or a dumb mix with black, there is no semblance that the process is being done correctly at all as shown with the fact the raw render has neither any very dark colors nor any very light colors.

Ideally, turning the contrast down all the way would get you the average color values of all the pixels in the screen as has been done in 2D programs since the late 20th century, turning it up would ideally mean that the light colors get lighter and the dark colors get darker rather than darkening the entire image (meaning that there would be no requirement to use the brightness slider at all for basic cases).

It just seems like a disappointment that such a basic node has been implemented in a glaringly incorrect fashion, Blender is probably the only program you can get right now that even does this.

Again, this has been tested on a buildbot MingW build from June9, using a Win7 64 bit machine with 16 gigs of RAM, an Ivy Bridge i7 processor, and an ATI GPU.

Thank you for looking into this.%%%

%%%Okay, whoever coded the brightness/contrast node apparently had no idea how the algorithm is supposed to work. To see the demonstration, render the cube, and watch the screen turn white, the screen turns white because the compositor has it being strung through the brightness/contrast node with the contrast all the way down. The problem is that when moving the contrast slider alone, Blender ends up doing nothing more than a dumb mix with white or a dumb mix with black, there is no semblance that the process is being done correctly at all as shown with the fact the raw render has neither any very dark colors nor any very light colors. Ideally, turning the contrast down all the way would get you the average color values of all the pixels in the screen as has been done in 2D programs since the late 20th century, turning it up would ideally mean that the light colors get lighter and the dark colors get darker rather than darkening the entire image (meaning that there would be no requirement to use the brightness slider at all for basic cases). It just seems like a disappointment that such a basic node has been implemented in a glaringly incorrect fashion, Blender is probably the only program you can get right now that even does this. Again, this has been tested on a buildbot MingW build from June9, using a Win7 64 bit machine with 16 gigs of RAM, an Ivy Bridge i7 processor, and an ATI GPU. Thank you for looking into this.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'

%%%I didn't look at the implementation, but consider that for compositing animation shots, the nodes might intentionally work different than 2D image editors. If the node depends on the average color of the entire image the effect is no longer local and any pixel in the image can influence any other pixel. For 2D image editing it's all under user control so it's not so bad, but when you apply an effect to an entire animation sequence it may not give coherent results from one frame to the next.%%%

%%%I didn't look at the implementation, but consider that for compositing animation shots, the nodes might intentionally work different than 2D image editors. If the node depends on the average color of the entire image the effect is no longer local and any pixel in the image can influence any other pixel. For 2D image editing it's all under user control so it's not so bad, but when you apply an effect to an entire animation sequence it may not give coherent results from one frame to the next.%%%
Member

%%%You're bringing in negative assumptions and biased opinions, that's not a good start for a valid bug report.

If you would search for brightness/contrast in Photoshop you can learn that they struggled with it too:
http://www.photoshopessentials.com/photo-editing/brightness-contrast/

And you can find remarks online like "I consider the Brightness/Contrast feature of Photoshop and other image applications one of the worst methods ..."
Or scientific papers "Currently, there is no conventional formula for brightness calculation, and..."
And plenty of places where people try to find the formula behind photoshop's method.

In Blender's code, there's a comment:

OpenCV is a well regarded scientific project for computer vision.

The bottom line however is that I agree that the results of brightness/contrast are disappointing with extreme ranges. However, it's very similar to standard tools I have here for it, like Apple's Preview.app, the color options there does 100% the same for contrast. In GIMP they have a different formula though.

The photoshopessentials page explains well what possible improvements could be.

I'll assign to compositor coder Jeroen for future reference.%%%

%%%You're bringing in negative assumptions and biased opinions, that's not a good start for a valid bug report. If you would search for brightness/contrast in Photoshop you can learn that they struggled with it too: http://www.photoshopessentials.com/photo-editing/brightness-contrast/ And you can find remarks online like "I consider the Brightness/Contrast feature of Photoshop and other image applications one of the worst methods ..." Or scientific papers "Currently, there is no conventional formula for brightness calculation, and..." And plenty of places where people try to find the formula behind photoshop's method. In Blender's code, there's a comment: * The algorithm is by Werner D. Streidt: * http://visca.com/ffactory/archives/5-99/msg00021.html * Extracted of OpenCV demhist.c OpenCV is a well regarded scientific project for computer vision. The bottom line however is that I agree that the results of brightness/contrast are disappointing with extreme ranges. However, it's very similar to standard tools I have here for it, like Apple's Preview.app, the color options there does 100% the same for contrast. In GIMP they have a different formula though. The photoshopessentials page explains well what possible improvements could be. I'll assign to compositor coder Jeroen for future reference.%%%
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Author

%%%I see, sorry about the strong intro (yet there's no 'edit' button when going these reports), I was trying to use it to aid in some comparison between the new sampler recently committed to Cycles and the old, to test against a converged image to see which one has the superior convergence (seeing which of the averaged colors is closer to the color of the image already converged, I was just shocked that doing such a thing seemingly turned out to be impossible).

I was further shocked when I rendered out a simple black image and used it to create a white image, perhaps the node should come bundled with multiple algorithms so it's more easily usable for those making still image.

So in short, sorry if i wasted your time in this case, I'll try to be more careful in writing and making these reports.%%%

%%%I see, sorry about the strong intro (yet there's no 'edit' button when going these reports), I was trying to use it to aid in some comparison between the new sampler recently committed to Cycles and the old, to test against a converged image to see which one has the superior convergence (seeing which of the averaged colors is closer to the color of the image already converged, I was just shocked that doing such a thing seemingly turned out to be impossible). I was further shocked when I rendered out a simple black image and used it to create a white image, perhaps the node should come bundled with multiple algorithms so it's more easily usable for those making still image. So in short, sorry if i wasted your time in this case, I'll try to be more careful in writing and making these reports.%%%
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#35766
No description provided.