About PS processing gif diffusion transparency dithering

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
beginner
Posts: 15
Joined: 2016-05-12T18:21:50-07:00
Authentication code: 1151

About PS processing gif diffusion transparency dithering

Post by beginner »

a picture in png format(1.png):
Image

Use PS to generate a gif image, using a diffuse transparency dithering option(1.gif):
Image

convert 1.png -channel RGBA -separate ( +clone -remap pattern:gray50 ) +swap -combine 2.gif
Image


What parameters can be added using convert.exe to generate the same gif as ps?

Erase red circled area content:

Image

thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: About PS processing gif diffusion transparency dithering

Post by snibgo »

After cloning the alpha channel, before remapping it, you can process it any way you want. For example:

Code: Select all

convert "1104123729!2.png" -channel RGBA -separate ( +clone -black-threshold 50% -remap pattern:gray50 ) +swap -combine 2b.gif

convert "1104123729!2.png" -channel RGBA -separate ( +clone -level 50,100% -remap pattern:gray50 ) +swap -combine 2c.gif
snibgo's IM pages: im.snibgo.com
beginner
Posts: 15
Joined: 2016-05-12T18:21:50-07:00
Authentication code: 1151

Re: About PS processing gif diffusion transparency dithering

Post by beginner »

convert "1104123729!2.png" -channel RGBA -separate ( +clone -level 50,100% -remap pattern:gray50 ) +swap -combine 2c.gif

Thank you very much, snibgo.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: About PS processing gif diffusion transparency dithering

Post by snibgo »

Good stuff.

Incidentally, you use "pattern:gray50" as the image for remapping. This has 32*32 = 1024 pixels, each of which is either black or white. So IM has to create the 1024 pixels, then analyze them to find those colours. This part of the command will be much faster if you create an image with just two pixels, for example "-size 2x1 pattern:gray50".
snibgo's IM pages: im.snibgo.com
beginner
Posts: 15
Joined: 2016-05-12T18:21:50-07:00
Authentication code: 1151

Re: About PS processing gif diffusion transparency dithering

Post by beginner »

Thank you for your help
May joy and health be with you always.
Post Reply