Trouble with unwanted Offset

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
User avatar
Posts: 1
Joined: 2019-07-14T09:45:58-07:00
Authentication code: 1152

Trouble with unwanted Offset

Post by levithanh337 » 2019-07-14T09:49:11-07:00

Hi there!

I'm trying to convert an image in a few steps.
It starts off as a 580x480 image and I only need 474x474 of those pixels.
So it goes from the original image, then it gets converted with a 474x474 circular mask (so now only the pixels inside of the circle are visible).
After that, I remove some colours from the image.

I'm certain the step that causes the offsetting is the mask.

Here's my steps:

convert ORIGINAL.gif \
MASK.png \
-alpha Off \
-compose CopyOpacity \
-composite \
-trim \

Does anyone have any suggestions to achieve the same result without offsets?

Posts: 11812
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Trouble with unwanted Offset

Post by snibgo » 2019-07-14T10:41:19-07:00

If "-trim" actually trims, that creates offsets. Follow that with "+repage" if you want to remove the offsets.

Hint: Sprinkle "-write info:" anywhere you want to follow the progress of the changes. That would tell you where the offsets were added.
snibgo's IM pages:

Post Reply