You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this is the function description of brightnessContrast
// brightnessContrast adjusts the brightness and contrast of the image.
// The brightness value ranges between -1 .. 1, with 0 being neutral.
// The contrast value ranges between 0 .. 127, with 1 being neutral.
ImageData brightnessContrast(ImageData pixels, float brightness, float contrast)
if i'm looking into the function your contrast will be calculated like this:
contrastAdjust = -128*contrast + 128;
For a range from 0 to 127 i get values from 128 to -16.128. I uses the function parallel to PHP GD imagefilter. I create a live editing image with javascript and on save I generate an image with PHP and the images doesn't match. If I choose a range from 0 to 2 with 1 being neutral. I get values from 128 to -128 this machtes with the PHP imagefilter contrast range and I get two images they were very similar.
Is there a fault in my mind or in the function description?
Greetings
Simon
The text was updated successfully, but these errors were encountered:
Hi, this is the function description of brightnessContrast
// brightnessContrast adjusts the brightness and contrast of the image.
// The brightness value ranges between -1 .. 1, with 0 being neutral.
// The contrast value ranges between 0 .. 127, with 1 being neutral.
ImageData brightnessContrast(ImageData pixels, float brightness, float
contrast)
if i'm looking into the function your contrast will be calculated like
this:
contrastAdjust = -128*contrast + 128;
For a range from 0 to 127 i get values from 128 to -16.128. I uses the
function parallel to PHP GD imagefilter. I create a live editing image with
javascript and on save I generate an image with PHP and the images doesn't
match. If I choose a range from 0 to 2 with 1 being neutral. I get values
from 128 to -128 this machtes with the PHP imagefilter contrast range and I
get two images they were very similar.
Is there a fault in my mind or in the function description?
Hi, this is the function description of brightnessContrast
// brightnessContrast adjusts the brightness and contrast of the image.
// The brightness value ranges between -1 .. 1, with 0 being neutral.
// The contrast value ranges between 0 .. 127, with 1 being neutral.
ImageData brightnessContrast(ImageData pixels, float brightness, float contrast)
if i'm looking into the function your contrast will be calculated like this:
contrastAdjust = -128*contrast + 128;
For a range from 0 to 127 i get values from 128 to -16.128. I uses the function parallel to PHP GD imagefilter. I create a live editing image with javascript and on save I generate an image with PHP and the images doesn't match. If I choose a range from 0 to 2 with 1 being neutral. I get values from 128 to -128 this machtes with the PHP imagefilter contrast range and I get two images they were very similar.
Is there a fault in my mind or in the function description?
Greetings
Simon
The text was updated successfully, but these errors were encountered: