How do I prevent interpolation when rotating an image.
Posted: 2011-03-23T04:17:04-07:00
I am something of an Imagemagick noob and have been attempting to resize and rotate images with ImageMagick in the command line using this command:
At the same time, I want to make the resulting white background transparent.
The whole thing works pretty well, except I seem to end up with an interpolated border merging the white background produced by the rotation into the original image.
Is there any way to turn off this effect so that only the background and the transposed pixels from the original image are produced?
Here are the before and after images.
The effect is difficult to see on a light background, but the site design requires the image to be overlaid on a black background so I am attaching a screenshot clip below.
It occurred to me that first adding a black border to the original image would alleviate the problem, but it did not. The jagged light border still appeared outside the black border.
Many thanks for any help you can give.
Richard
Code: Select all
convert -resize 230x330 -rotate 15 -transparent white laugh.png laugh_skewed.png
At the same time, I want to make the resulting white background transparent.
The whole thing works pretty well, except I seem to end up with an interpolated border merging the white background produced by the rotation into the original image.
Is there any way to turn off this effect so that only the background and the transposed pixels from the original image are produced?
Here are the before and after images.
The effect is difficult to see on a light background, but the site design requires the image to be overlaid on a black background so I am attaching a screenshot clip below.
It occurred to me that first adding a black border to the original image would alleviate the problem, but it did not. The jagged light border still appeared outside the black border.
Many thanks for any help you can give.
Richard