.jpg to .rgb, -colorspace vs. -set colorspace
Posted: 2017-04-01T11:56:33-07:00
I have an sRGB-encoded JPEG image.
I would like to convert it to "RGB" format, i.e., pure image data in R-G-B triplets with no headers, etc.
In addition, I would like to convert it in two ways, one so that the R-G-B output is sRGB-encoded, and
one so that the R-G-B output is linear.
To convert to sRGB-encoded R-G-B, I did
And to convert to linear R-G-B, I did
but that produced output identical to the first case.
When I do
then the output is different, but I'm unclear why or whether it did what I intended.
Looking at viewtopic.php?t=17207, it says
-set colorspace is "setting" in my case, or why it makes a difference.
Can someone please set me on the right path.
MV
I would like to convert it to "RGB" format, i.e., pure image data in R-G-B triplets with no headers, etc.
In addition, I would like to convert it in two ways, one so that the R-G-B output is sRGB-encoded, and
one so that the R-G-B output is linear.
To convert to sRGB-encoded R-G-B, I did
Code: Select all
convert input.jpg output.rgb
Code: Select all
convert input.jpg -colorspace RGB output.rgb
When I do
Code: Select all
convert input.jpg -set colorspace RGB -colorspace RGB output.rgb
Looking at viewtopic.php?t=17207, it says
which matches my reading of the docs, but since .rgb format has no header I don't understand what-colorspace : change the way actual pixel are represented
-set colorspace : tell image the data is represented this way, but does not touch the data
-set colorspace is "setting" in my case, or why it makes a difference.
Can someone please set me on the right path.
MV