sekitaka
sekitaka

Reputation: 1032

Rotate PNG by ImageMagick

I want to rotate PNG file by convert command. like this.

convert -background 'rgba(0,0,0,0.5)' -rotate 45 1.png r1.png

But result PNG file is wrong like following. https://docs.google.com/spreadsheet/ccc?key=0AqzGWe_mT6dwdEIwa04xRldwVGtOX1VGbVJhRnZwX0E

The gray space is correct.

I don't know why black space exists.

What am I wrong?

thank you.


convert -version Version: ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP http://www.imagemagick.org Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

Upvotes: 9

Views: 8430

Answers (2)

Mohamed Elzarei
Mohamed Elzarei

Reputation: 546

This worked for me

$ convert 1.png -distort SRT -ANGLE_IN_DEGREES -gravity center r1.png

Upvotes: 1

Bonzo
Bonzo

Reputation: 5299

The image to modify comes straight after convert.

Try:

convert 1.png -background "rgba(0,0,0,0.5)" -rotate 45 r1.png

Upvotes: 13

Related Questions