Page 1 of 1
Convert from grayscale to sRGB colorspace
Posted: 2015-08-26T13:50:37-07:00
by q3cpma
The tast I'm trying to accomplish isn't extraordinary but i'm failing hard at it. I've seen some forum topics, but their solutions didn't work for me.
Code: Select all
convert -colorspace sRGB -define "colorspace:auto-grayscale=off" -define "png:color-type=6" in.png out.png
Didn't work. Also tried with
Code: Select all
-set "colorspace:auto-grayscale" "false"
Thanks for reading.
Re: Convert from grayscale to sRGB colorspace
Posted: 2015-08-26T14:06:31-07:00
by fmw42
There is no equivalent -define to the -set option. I believe that is only available in current release, IM 6.9.2-0. You do not mention your version of IM nor platform.
Re: Convert from grayscale to sRGB colorspace
Posted: 2015-08-26T14:13:55-07:00
by snibgo
In modern versions of IM, grayscale is already in sRGB colorspace, meaning that it has a complex gamma curve that is roughly gamma=2.2.
What do you really want to do? How do you know you are not already doing it?
Re: Convert from grayscale to sRGB colorspace
Posted: 2015-08-26T15:20:29-07:00
by q3cpma
Sorry, I was using an outdated version. I needed PNG24 output to go with Vapoursynth's IM plugin.
Using
Code: Select all
convert -colorspace sRGB -set "colorspace:auto-grayscale" "false" in.png PNG24:out.png
worked.
Also, it looks like the -define option is listed
here.
Re: Convert from grayscale to sRGB colorspace
Posted: 2015-08-26T16:45:19-07:00
by fmw42
q3cpma wrote:Also, it looks like the -define option is listed
here.
I recently asked the developer if there was a -define equivalent. He told me no. So I either misunderstood or he has recently added it.
Re: Convert from grayscale to sRGB colorspace
Posted: 2015-08-27T02:50:18-07:00
by q3cpma
Looks like it works too with -define (identify -format '%[colorspace]' out.png gives me sRGB).
Re: Convert from grayscale to sRGB colorspace
Posted: 2015-08-27T14:14:02-07:00
by dlemstra
I recently asked the developer if there was a -define equivalent. He told me no. So I either misunderstood or he has recently added it.
Or he works too much with IM7
This did not work in IM7 but does in IM6. We are now investigating how we can fix it in IM7.