- convert input.tga +matte -resize 50% output.tga
Premultiplied Alpha Targas in batch process
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
An alturnative that may be easier is to use the new multi-image -separate option.  This will separate an image into a list of gray scale images on per channel.  This makes it useful to disconnect any color-alpha relationship that may be involved.   Remember more options with IM are applied to ALL images in a image sequence.
			
			
									
						
							Code: Select all
  convert Asimov.tga -channel RGBA -separate -resize 50% -combine image.tgaAnthony Thyssen   -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
			
						https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Hmmm after trying this myself I found that using -separate on your image produces four images, but each still contained the alpha channel!!!!!   I think that may have been an unexpected feature, and in this case unwanted.
Adding a +matte after the -separate fixed the problem.
I'll update the IM Examples page about -separate to make note of this.
			
			
									
						
							Adding a +matte after the -separate fixed the problem.
Code: Select all
  convert Asimov.tga -channel RGBA -separate +matte -resize 50% -combine image.tga
Anthony Thyssen   -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
			
						https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Should be much faster on larger images.  -fx has to interpriate the mathematical argument it is given once for every pixel and color channel involved.  -separate just does the job directly.
			
			
									
						
							Anthony Thyssen   -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
			
						https://imagemagick.org/Usage/

