Still struggling with composites and transparency
Posted: 2019-04-29T03:45:13-07:00
ImageMagick 6.9.10-14 Q16 i686 GNU/Linux, 32 bit
Delegates (built-in): bzlib fontconfig freetype jbig jng jpeg lcms lqr lzma pangocairo png tiff wmf x xml zlib
*Still* can't get my head around transparency, backgrounds & foregrounds and compositing ...
I'm pretty sure this will turn out to be trivial, so apologies in advance for that.
I want to create images which take as their input any old jpg or png I have to hand, and create as an output an image that "looks like a postage stamp" - i.e. has the scalloped edges characteristic of perforation.
This image will then be composited onto another image (that of an envelope or postcard); there will be a variety of envelope/postcard images, each with different base colours and textures.
The critical thing is to have the perforated edges show the colour/texture of the image "beneath".
I've got myself a "postage stamp template" as a png, and I can manage to do this
But I can't work out how to make the step to the final image with the output from the above composited onto the envelope.
I've posted all of the files to imagebin:
example_image.png --> https://imagebin.ca/v/4fM6iVyF0vPJ
stamp_template.png --> https://imagebin.ca/v/4fM78Qe26DdV
example_output.png --> https://imagebin.ca/v/4fMDj7dXjU30
example_background --> https://imagebin.ca/v/4fMDvbwBp6R0
I'm sorry if this is unclear in any way.
Delegates (built-in): bzlib fontconfig freetype jbig jng jpeg lcms lqr lzma pangocairo png tiff wmf x xml zlib
*Still* can't get my head around transparency, backgrounds & foregrounds and compositing ...
I'm pretty sure this will turn out to be trivial, so apologies in advance for that.
I want to create images which take as their input any old jpg or png I have to hand, and create as an output an image that "looks like a postage stamp" - i.e. has the scalloped edges characteristic of perforation.
This image will then be composited onto another image (that of an envelope or postcard); there will be a variety of envelope/postcard images, each with different base colours and textures.
The critical thing is to have the perforated edges show the colour/texture of the image "beneath".
I've got myself a "postage stamp template" as a png, and I can manage to do this
Code: Select all
# convert example_image.png stamp_template.png -transparent white -composite -resize 20% example_output.png
I've posted all of the files to imagebin:
example_image.png --> https://imagebin.ca/v/4fM6iVyF0vPJ
stamp_template.png --> https://imagebin.ca/v/4fM78Qe26DdV
example_output.png --> https://imagebin.ca/v/4fMDj7dXjU30
example_background --> https://imagebin.ca/v/4fMDvbwBp6R0
I'm sorry if this is unclear in any way.