Adding Checkerboard pattern to transparency

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
RedFlyer
Posts: 8
Joined: 2014-01-30T16:57:55-07:00
Authentication code: 6789

Adding Checkerboard pattern to transparency

Post by RedFlyer »

So I'm working on making IM convert pngs and gifs with transparency to jpgs and use a checkerboard pattern to represent the transparency. Coming from photoshop the built in checkerboard pattern in IM is really dark and doesn't really read right. I've worked out one solution of bringing in a captured checker pattern from PS and tiling it as a background.

composite -compose Dst_Over -tile checkerBG.gif alphapng.png output.jpg

Just wondering if there is a way to edit the builtin checkerboard pattern at all(possibly to lighten) or if there are any thoughts on the command I've got so far.

It seems to work with tiffs and some PSDs; only works with 8bit grayscale, RGB, and LAB.

Any critiques are welcome!
thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Adding Checkerboard pattern to transparency

Post by fmw42 »

try this using the IM internal logo: image. Adjust the brightness-contrast as desired. Then insert your own image.

# create transparent image

Code: Select all

convert logo: -transparent white logot.png
# process

Code: Select all

convert logot.png \( -size 640x480 tile:pattern:checkerboard -brightness-contrast 20,10 \) +swap -compose over -composite show:
On windows use (....) rather than \(....\)
Post Reply