Page 1 of 1

Convert hdr image to non-hdr image

Posted: 2019-06-24T03:23:48-07:00
by dkrikun0
Hi,

I would like to convert an HDR (i.e in NetPFM format) image to non-HDR image (i.e. NetPGM).
The conversion needs to be "viewer-friendly", that is the resulting image needs be contrast, without cutting off information etc.

How could I achieve this with ImageMagick 7.0.8 Q16, with HDRI?

Thanks!

Re: Convert hdr image to non-hdr image

Posted: 2019-06-24T06:06:01-07:00
by snibgo
Does "-auto-level" do what you want? If not, please link to a sample input, and say what output you want.

Re: Convert hdr image to non-hdr image

Posted: 2019-06-24T07:37:43-07:00
by dkrikun0
I've tried
`magick src.pfm -auto-level src.pgm`

Now both feh and sxiv say src.pgm is broken, is there something else?

Re: Convert hdr image to non-hdr image

Posted: 2019-06-24T07:44:29-07:00
by snibgo
Please link to a sample input.

Re: Convert hdr image to non-hdr image

Posted: 2019-06-24T07:51:33-07:00
by dkrikun0
magick rose: rose.pfm
magick rose.pfm -auto-level rose.pgm

Re: Convert hdr image to non-hdr image

Posted: 2019-06-24T08:31:58-07:00
by snibgo
It seems that IM is writing rose.pgm as 32 bits/channel. (Just one channel, of course.) Gimp can't read the result.

If we insert "-depth 16" before writing, Gimp can read it fine.

Does that help?

Re: Convert hdr image to non-hdr image

Posted: 2019-06-25T00:49:58-07:00
by dkrikun0
Almost, had to use -depth 8, for feh/sxiv.
Do I still need -auto-level?

Re: Convert hdr image to non-hdr image

Posted: 2019-06-25T03:49:12-07:00
by snibgo
dkrikun0 wrote:The conversion needs to be "viewer-friendly", that is the resulting image needs be contrast, without cutting off information etc.
I don't really understand your question. Perhaps "-auto-level" does what you want.