Overlay an Image on Top of Another with GraphicsMagick

Command

gm composite -resize 1920x1080 -dissolve 40 overlay_image.jpg base_image.jpg result_image.jpg

Break Down

The resize option resizes the overlay to the specified dimensions. You can specify just the height with x1080 or just the width with 1920. Typically you would want this to be the same width as the base image.

Continue reading

Advertisements

Create thumbnails of PDF’s with Node JS and GraphicsMagick

1. Install GraphicsMagick

On Ubuntu (14.04):

sudo apt-get install graphicsmagick

 

2. Install the Node library in your project

npm install gm

 

3. Write  a script

Below I show two ways of creating a thumbnail. The first way creates a JPG using various GraphicsMagick functions, I prefer this way because it gives me fine grained control over the thumbnail. The second uses a built in function for thumbnails, which is easy to use but isn’t as flexible.
Continue reading