I've been stuck trying to get this to work so hopefully some more seasoned users can help.
I have 2 OpenEXR files, one that is RGB and one that is just an alpha. I want to merge the two and make a single OpenEXR that is RGBA.
I'm stuck with the syntax, but any help would be appreciated.
Thanks!
Combining OpenEXRs
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Combining OpenEXRs
In general (but I cannot say about EXR format specifically), one adds a single channel to an rgb image as follows:lapzerus wrote:I've been stuck trying to get this to work so hopefully some more seasoned users can help.
I have 2 OpenEXR files, one that is RGB and one that is just an alpha. I want to merge the two and make a single OpenEXR that is RGBA.
I'm stuck with the syntax, but any help would be appreciated.
Thanks!
convert rgbimage alphaimage -alpha off -compose copy_opacity -composite rgbaimage
see http://www.imagemagick.org/Usage/compose/#copyopacity
Re: Combining OpenEXRs
Sorry I think I need to clarify,
I want to keep the original RGB image exactly the same, except I want the second EXR file that is just an alpha to be merged together to I have the original RGB plus the new alpha as a seperate channel.
The result of compositing my two test images right now with your method gives me a blank image.
Thanks for your help so far.
I want to keep the original RGB image exactly the same, except I want the second EXR file that is just an alpha to be merged together to I have the original RGB plus the new alpha as a seperate channel.
The result of compositing my two test images right now with your method gives me a blank image.
Thanks for your help so far.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Combining OpenEXRs
Your two input images will not be changed. The resulting image will have 4 channels, r,g,b,a.want to keep the original RGB image exactly the same, except I want the second EXR file that is just an alpha to be merged together to I have the original RGB plus the new alpha as a seperate channel.
But as I said, I don't know how well IM handles EXR. What version of IM do you have? What Q level? What platform? Do you have the EXR delegate library installed?
The command I gave you is standard for combining a grayscale single channel as the alpha channel to an RGB image. But perhaps your IM version is too old for that compose method?
This command works very well for generating rgba PNG or TIF for example.
Note that as far as I know, IM only can handle EXR "half" format.
Re: Combining OpenEXRs
I grabbed the lastest source of IM and the Q level is set to 16. I grabbed the Openexr source too from www.openexr.com and compiled it all in VC2005 for windows platform.
My IM can open openexrs and write them, but I dont see them it under delegates.
Name Value
-------------------------------------------------------------------------------
NAME ImageMagick
Path: C:\ImageMagick-6.6.2\VisualMagick\bin\configure.xml
Name Value
-------------------------------------------------------------------------------
CC vs8
CC vs8
COPYRIGHT Copyright (C) 1999-2010 ImageMagick Studio LLC
COPYRIGHT Copyright (C) 1999-2010 ImageMagick Studio LLC
DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
HOST windows-unknown-linux-gnu
HOST windows-unknown-linux-gnu
LIB_VERSION 0x662
LIB_VERSION 0x662
LIB_VERSION_NUMBER 6,6,2,0
LIB_VERSION_NUMBER 6,6,2,0
NAME ImageMagick
NAME ImageMagick
RELEASE_DATE 2010-06-01
RELEASE_DATE 2010-06-01
VERSION 6.6.2
VERSION 6.6.2
WEBSITE http://www.imagemagick.org
WEBSITE http://www.imagemagick.org
My IM can open openexrs and write them, but I dont see them it under delegates.
Name Value
-------------------------------------------------------------------------------
NAME ImageMagick
Path: C:\ImageMagick-6.6.2\VisualMagick\bin\configure.xml
Name Value
-------------------------------------------------------------------------------
CC vs8
CC vs8
COPYRIGHT Copyright (C) 1999-2010 ImageMagick Studio LLC
COPYRIGHT Copyright (C) 1999-2010 ImageMagick Studio LLC
DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
HOST windows-unknown-linux-gnu
HOST windows-unknown-linux-gnu
LIB_VERSION 0x662
LIB_VERSION 0x662
LIB_VERSION_NUMBER 6,6,2,0
LIB_VERSION_NUMBER 6,6,2,0
NAME ImageMagick
NAME ImageMagick
RELEASE_DATE 2010-06-01
RELEASE_DATE 2010-06-01
VERSION 6.6.2
VERSION 6.6.2
WEBSITE http://www.imagemagick.org
WEBSITE http://www.imagemagick.org
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Combining OpenEXRs
Did you install the OpenEXR before installing IM?
Don't know about Windows, but on my Mac, my delegates looks like:
DELEGATES bzlib fftw fontconfig freetype gs jpeg jng jp2 lcms lqr mpeg openexr png rsvg tiff x11 xml zlib
IM 6.6.2.1 Q16 Mac OSX Tiger
Strange that all your lines are doubled?
Type:
convert -list configure
and look at the DELEGATES line.
Don't know about Windows, but on my Mac, my delegates looks like:
DELEGATES bzlib fftw fontconfig freetype gs jpeg jng jp2 lcms lqr mpeg openexr png rsvg tiff x11 xml zlib
IM 6.6.2.1 Q16 Mac OSX Tiger
Strange that all your lines are doubled?
Type:
convert -list configure
and look at the DELEGATES line.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Combining OpenEXRs
This works for me:
convert logo: logo.exr
convert logo: -channel b -separate logob.exr
convert logo.exr logob.exr -alpha off -compose copy_opacity -composite logot.exr
IM 6.6.2.1 Q16 Mac OSX Tiger
convert logo: logo.exr
convert logo: -channel b -separate logob.exr
convert logo.exr logob.exr -alpha off -compose copy_opacity -composite logot.exr
IM 6.6.2.1 Q16 Mac OSX Tiger
Re: Combining OpenEXRs
I'm having a similar problem. I can do operations on EXR files (convert, etc.) but I dont see it in my list of delegates.
I compiled just fine. Linked to all the requisite openEXR libs and headers but still dont see anything. In the magic-conf file, I have added
I am having problems pertaining to using the magick++ api with openEXR. My demo application crashes when I try to read in a file with an EXR extension.
For ex:
breaks. Any ideas?
Code: Select all
-----------------------------------------------------------------------
CC vs8
CC vs8
COPYRIGHT Copyright (C) 1999-2010 ImageMagick Studio LLC
COPYRIGHT Copyright (C) 1999-2010 ImageMagick Studio LLC
DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
HOST windows-unknown-linux-gnu
HOST windows-unknown-linux-gnu
LIB_VERSION 0x662
LIB_VERSION 0x662
LIB_VERSION_NUMBER 6,6,2,7
LIB_VERSION_NUMBER 6,6,2,7
NAME ImageMagick
NAME ImageMagick
RELEASE_DATE 2010-07-15
RELEASE_DATE 2010-07-15
VERSION 6.6.2
VERSION 6.6.2
WEBSITE http://www.imagemagick.org
WEBSITE http://www.imagemagick.org
Code: Select all
#define MAGICKCORE_OPENEXR_DELEGATE
For ex:
Code: Select all
Image testEXR("testImage.exr");
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Combining OpenEXRs
If openexr is not in your delegates list, then I don't think IM recongnizes its existence. But I don't use windows and don't know the issues related to getting openexr working under Windows IM.