Andy Leszczynski on wrote...
| Hi
|
| I am looking for two kind of conversions:
| -something like straighten in Picasa - it rotates the
| picture yet crops it to the largest possible rectangle
See rotate examples, in "Distorting Images"
http://www.cit.gu.edu.au/~anthony/graphics/i
magick6/distorts/#rotate
Especially the last example, wich uses a compose to crop the
image
back to its original size after the rotation.
| -something like convert -extent but the image is
| centered and the background if filled with desired
| color.
|
You can do -extent with a specific color quite simply.
Use a viewport crop (add a ! flag), to crop/extend the image
canvas to
the desired size, then 'flatten' it to fill out that
canvas with the
desired color..
convert rose: -crop 100x100+0+0\! \
-background blue -flatten \
rose_extent_blue.png
You can even offset the image on the canvas, though remember
the crop
positions the 'viewport' or window, so the offset is for
the canvas,
NOT for the image. EG use a negative offset for a positive
image offset
convert rose: -crop 100x100-20-20\! \
-background blue -flatten \
rose_extent_blue_offset.png
This is slowed than -extent which is designed for speed, in
resizing
images that will be completely rebuild, or the user does not
care about
what goes into any extra space.
for more info see "Cutting and Bordering"
examples
http://www.cit.gu.edu.au/~anthony/graphics/imagick6/cro
p/
Specifically Viewport Crop
http://www.cit.gu.edu.au/~anthony/graphic
s/imagick6/crop/#crop_viewport
Anthony Thyssen ( System Programmer ) <A.Thyssen griffith.edu.au>
-----------------------------------------------------------
------------------
Did you ever have the feeling that the world was an AC
coffee pot
and you were DC? -- Dean Alan Foster, ``
Glory Lane ''
-----------------------------------------------------------
------------------
Anthony's Home is his Castle http://www.cit.gu.
edu.au/~anthony/
_______________________________________________
Magick-users mailing list
Magick-users imagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick
-users
|