Problem/Question with Saturation Transformation

Moderator: jsachs

Post Reply
Winfried
Posts: 239
Joined: June 18th, 2010, 4:27 pm
What is the make/model of your primary camera?: Pentax K1

Problem/Question with Saturation Transformation

Post by Winfried »

I am working (or lets call it playing) with the different ways of converting a color image to black and white.
It seems to me that there might be a problem with the saturation transformation.
- I started with a 48-bit color image
- with the Monochrome Transformation I extract the HSV-V chanel and get a 16-bit black and white image
- with the Saturation Transformation I reduce the color to zero and get a 48-bit color image
- with the Extract Chanel Transformation I extract the HSV-V chanel and get a 16-bit black and white image
So far everything works as expected, but counting the number of different colors shows quite a difference.
It seemes that the result of the Saturation Transforamtion is just a 24 bit file in reality.

Please have a look at the screen-shot.
Attachments
Number_of_Colors.jpg
Number_of_Colors.jpg (112.34 KiB) Viewed 1059 times
Winfried
-----
migrated to Windows 10 in Nov. 2019
PWP Pro 64
CUDA not available
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Problem/Question with Saturation Transformation

Post by jsachs »

The transformations are correct, but the problem is in the Count Colors command. The output of the Saturation transformation is a 48-bit color image while the output of Extract Channel is a 16-bit black and white image. The count colors command, for performance reasons, counts the number of 24-bit colors for 48-bit color images while it gives the correct answer for 16-bit black and white. If you convert the Saturation result to 16-bit B&W, then Count Colors gives the same answer as for the Extract Channels version.
Jonathan Sachs
Digital Light & Color
Winfried
Posts: 239
Joined: June 18th, 2010, 4:27 pm
What is the make/model of your primary camera?: Pentax K1

Re: Problem/Question with Saturation Transformation

Post by Winfried »

Thanks for the the explanation.
Winfried
-----
migrated to Windows 10 in Nov. 2019
PWP Pro 64
CUDA not available
jsachs
Posts: 4203
Joined: January 22nd, 2009, 11:03 pm

Re: Problem/Question with Saturation Transformation

Post by jsachs »

For the next release, I implemented a different and far more efficient algorithm for counting unique colors that works for 48-bit color images as well as the other types.
Jonathan Sachs
Digital Light & Color
Post Reply