convert -gamma has no effect for .ps-->.gif or .ps-->.png
Posted: 2009-08-21T09:33:46-07:00
Hi, I use convert in my gpl'ed program http://www.forkosh.com/mathtex.html which runs latex on a user-supplied math expression to produce a .dvi file, and then has several options to produce browser-displayable images. One option first runs dvips to get .dvi-->.ps, and then runs convert to get either .ps-->.gif or .ps-->.png (user's choice, defaults to .gif). The convert command line that's used is
convert -density 120 -gamma 0.5 -trim -transparent "#FFFFFF" dvips.ps convert.gif
(or convert.png for that last argument, depending on which image format is desired)
The problem is that I'm getting exactly the same convert.gif (or .png), byte-for-byte (files diff with no differences), regardless of the -gamma value on the command line. Pngs are always a bit darker than gifs, but all pngs are the same and all gifs are the same regardless of -gamma. And I'd like to be able to specify the gamma correction. I can provide sample .ps/.gif/.png/.whatever-you'd-like output.
When I first released mathtex in early 2007, I'm sure -gamma did work. And I haven't changed convert's command line since then. So I'm (wildly) guessing that some new release of convert may have affected its -gamma behavior, at least with respect to postscript input images. Can't find anything that I seem to be doing wrong, but, of course, that would be the easiest thing to fix.
Thanks for any suggestions,
John Forkosh
convert -density 120 -gamma 0.5 -trim -transparent "#FFFFFF" dvips.ps convert.gif
(or convert.png for that last argument, depending on which image format is desired)
The problem is that I'm getting exactly the same convert.gif (or .png), byte-for-byte (files diff with no differences), regardless of the -gamma value on the command line. Pngs are always a bit darker than gifs, but all pngs are the same and all gifs are the same regardless of -gamma. And I'd like to be able to specify the gamma correction. I can provide sample .ps/.gif/.png/.whatever-you'd-like output.
When I first released mathtex in early 2007, I'm sure -gamma did work. And I haven't changed convert's command line since then. So I'm (wildly) guessing that some new release of convert may have affected its -gamma behavior, at least with respect to postscript input images. Can't find anything that I seem to be doing wrong, but, of course, that would be the easiest thing to fix.
Thanks for any suggestions,
John Forkosh