remove alpha channel from TIFF

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
Falcon
Posts: 2
Joined: 2005-04-21T01:48:24-07:00

remove alpha channel from TIFF

Post 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?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: remove alpha channel from TIFF

Post by anthony »

Generally by telling IM to turn off the "Matte" channel.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Falcon
Posts: 2
Joined: 2005-04-21T01:48:24-07:00

Re: remove alpha channel from TIFF

Post 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.
roderikk
Posts: 1
Joined: 2011-12-06T14:49:18-07:00
Authentication code: 8675308

Re: remove alpha channel from TIFF

Post 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
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: remove alpha channel from TIFF

Post by el_supremo »

This should do it:

Code: Select all

MagickSetImageAlphaChannel($mgck_wnd,MW_DeactivateAlphaChannel);
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
Post Reply