Question on AdjustRGB
Question on AdjustRGB
Hi,
I am evaluating GD Picture and really need to do just one thing and that is color the white area's of a PNG to a specific RGB value. The adjustRGB value seems to do the trick except the negative values don't correspond with the RGB value I am trying to achieve. What is the formula to accomplish that?
Thanks,
ElmoDude
I am evaluating GD Picture and really need to do just one thing and that is color the white area's of a PNG to a specific RGB value. The adjustRGB value seems to do the trick except the negative values don't correspond with the RGB value I am trying to achieve. What is the formula to accomplish that?
Thanks,
ElmoDude
-
- Posts: 352
- Joined: Tue Sep 27, 2011 11:47 am
Re: Question on AdjustRGB
Hi,
The algorithm is pretty straight forward. The values you provide, whether negative or positive, are added to the specific color channel you want. Resulting in an increase in that color channel if the values are positive, and a decrease if the values are negative.
I hope this clarifies it a little bit more for you,
Best,
Sami
The algorithm is pretty straight forward. The values you provide, whether negative or positive, are added to the specific color channel you want. Resulting in an increase in that color channel if the values are positive, and a decrease if the values are negative.
I hope this clarifies it a little bit more for you,
Best,
Sami
Re: Question on AdjustRGB
There not quite that straight forward because there are no negative RGB Values. For example, how would I change the white to say R: 255 G: 255 B:0 like the sample above. Setting positive values don't work because the darker color component is then eliminated.The algorithm is pretty straight forward.
Re: Question on AdjustRGB
If I can get an answer on how to do this, or an alternative way, I will buy the control.
Hopefully this will clarify, I need to recolor the lighter shades to specific RGB values while keeping the darker shades.
Hopefully this will clarify, I need to recolor the lighter shades to specific RGB values while keeping the darker shades.
-
- Posts: 352
- Joined: Tue Sep 27, 2011 11:47 am
Re: Question on AdjustRGB
Hi,
Say you have a color white(255, 255, 255), and you supply values of 0, 0, -255 to the function, you will end up with a color of (255, 255, 0). But you also have to remember that this affects all the colors, meaning that if there is another color in the image: (255, 0, 50), the result will be (255, 0, 0) -since the value is clamped between 0 and 255.
If you want to swap a specific color and not all the colors of the image with another specific color, you'd be better off using:
https://www.gdpicture.com/guides/gdpicture/v9/html/con ... aging.html
I hope this helps.
Best,
Sami
Please see my answer before:There not quite that straight forward because there are no negative RGB Values.
I will explain further:The values you provide, whether negative or positive, are added to the specific color channel you want.
Say you have a color white(255, 255, 255), and you supply values of 0, 0, -255 to the function, you will end up with a color of (255, 255, 0). But you also have to remember that this affects all the colors, meaning that if there is another color in the image: (255, 0, 50), the result will be (255, 0, 0) -since the value is clamped between 0 and 255.
If you want to swap a specific color and not all the colors of the image with another specific color, you'd be better off using:
https://www.gdpicture.com/guides/gdpicture/v9/html/con ... aging.html
I hope this helps.
Best,
Sami
Re: Question on AdjustRGB
Thanks Sami. I did purchase the control and your solution kind of worked. I had to add an extra step of merging the original back over the one with the changed color, but it does work great.
-
- Posts: 352
- Joined: Tue Sep 27, 2011 11:47 am
Re: Question on AdjustRGB
Hi,
I'm glad it worked out.
Thank you for the return.
Best,
Sami
I'm glad it worked out.
Thank you for the return.
Best,
Sami
Who is online
Users browsing this forum: No registered users and 1 guest