montage: preserving all channels in .exr...

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
flamz
Posts: 6
Joined: 2015-06-14T12:59:16-07:00
Authentication code: 6789

montage: preserving all channels in .exr...

Post by flamz »

hello,
I am trying to "montage" a bunch of RGBA exr files into 1 tiled image.
I literally want to "copy and paste" each image into the tiled image without modifying any RGBA pixel values.
But ImageMagick insists on messing around with my alpha channel. No matter what option I use, it insists on treating it like a mask, when it is basically just part of the "color data".... (some pixels are blue, but 50% transparent, some pixels are blue but 10% transparent).

I use this:
montage.exe {image0} {image1} {image2} {image3} {image4} {image5} -background none -channel rgba -alpha on -tile 6x1 -geometry +0+0 ";

any tips?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: montage: preserving all channels in .exr...

Post by dlemstra »

Which version of ImageMagick are you using?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
flamz
Posts: 6
Joined: 2015-06-14T12:59:16-07:00
Authentication code: 6789

Re: montage: preserving all channels in .exr...

Post by flamz »

6.9
flamz
Posts: 6
Joined: 2015-06-14T12:59:16-07:00
Authentication code: 6789

Re: montage: preserving all channels in .exr...

Post by flamz »

hmm I've tried all sorts of other combinations, can't make this work.
anybody has any ideas?

cheers
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: montage: preserving all channels in .exr...

Post by dlemstra »

Can you share an image on something like dropbox/onedrive and post the command that you are using?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
flamz
Posts: 6
Joined: 2015-06-14T12:59:16-07:00
Authentication code: 6789

Re: montage: preserving all channels in .exr...

Post by flamz »

Sure, here's a zip with the source RGBA images, and the resulting montage (called cubemap_color_m414.233_75.38_373.8693.exr)

Command line I'm using "montage.exe top.exr bottom.exr left.exr right.exr up.exr down.exr -background none -channel rgba -alpha on -tile 6x1 -geometry +0+0 result.exr";

In the resulting image, the alpha channel is "correct", but the color components where alpha was < 1.0 were set to black (the clouds and sky are gone and replaced by black pixels).

https://drive.google.com/open?id=0B_KkT ... authuser=0
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: montage: preserving all channels in .exr...

Post by dlemstra »

I cannot reproduce your issue with ImageMagick 6.9.1-6 beta (will be released soon). How are you testing if the image still has transparency? If I convert 'cubemap_color_m414.233_75.38_373.8693.exr' to a png file I get an image with an alpha channel. Are you converting the image to a .jpg file? JPEG has no transparency and will make the transparent color black.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
flamz
Posts: 6
Joined: 2015-06-14T12:59:16-07:00
Authentication code: 6789

Re: montage: preserving all channels in .exr...

Post by flamz »

I am not doing anything other than calling the command line I posted. I am not converting into JPEG or anything like that.
I am simply piping RGBA exr files into montage, but somehow it drops the color of pixels that have transparency.

here's a picture showing what I see when I open a source image (top) and the result (bottom) in Photoshop.
As you can see, the source image has a blue sky and clouds (which have an alpha value of 0.0) and mountains which have an alpha value of 1.0.

https://drive.google.com/a/unity3d.com/ ... pmak0/edit

In the resulting image however, you can see that the sky RGB pixel values were not "copied", only the alpha values were successfully copied.

I am missing some operation on the command line?

-background none -channel rgba -alpha on -tile 6x1 -geometry +0+0 result.exr

?
flamz
Posts: 6
Joined: 2015-06-14T12:59:16-07:00
Authentication code: 6789

Re: montage: preserving all channels in .exr...

Post by flamz »

I solve my problem by first splitting all input files into 4 files representing each R G B and A channels. I then "montage" each channels into 4 tiled cubemaps and finaly recombine all those into a single RGBA cubemap.
thanks !
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: montage: preserving all channels in .exr...

Post by dlemstra »

I think you are getting this output because of how the montage is created. I just realized you could also just do this:

Code: Select all

convert.exe {image0} {image1} {image2} {image3} {image4} {image5} +append {output}
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply