Page 1 of 1

remove alpha channel from TIFF

Posted: 2007-06-14T04:49:17-07:00
by Falcon
Hi!
I am using MagickWand in PHP.

I create image and save in TIFF, but ImageMagick generate TIFF file with alpha channel.

Code: Select all

$mgck_wnd = NewMagickWand(); 
MagickNewImage( $mgck_wnd, WIDTH, HEIGHT );

// Draw
....

MagickSetImageColorspace( $mgck_wnd, MW_CMYKColorspace );
MagickSetImageType( $mgck_wnd, MW_ColorSeparationType );
MagickSetFormat( $mgck_wnd, 'TIFF' );
MagickEchoImageBlob( $mgck_wnd );
How generate TIFF file without alpha channel?

Re: remove alpha channel from TIFF

Posted: 2007-06-14T17:19:28-07:00
by anthony
Generally by telling IM to turn off the "Matte" channel.

Re: remove alpha channel from TIFF

Posted: 2007-06-14T23:56:37-07:00
by Falcon
anthony wrote:Generally by telling IM to turn off the "Matte" channel.
I don't find functions in MagickWand for manipulation with channels.
How implement turning off "Matte" channel in code.

Re: remove alpha channel from TIFF

Posted: 2011-12-07T00:34:20-07:00
by roderikk
Slightly related, to turn of alpha on the command line you run:

Code: Select all

convert input.tif -alpha off output_no_alpha.tif

Re: remove alpha channel from TIFF

Posted: 2011-12-07T08:35:15-07:00
by el_supremo
This should do it:

Code: Select all

MagickSetImageAlphaChannel($mgck_wnd,MW_DeactivateAlphaChannel);
Pete