On Sat, 5 Dec 2009 11:16:21 +1100 (EST) "damien dunlop" <[email protected]> wrote:
| I have not seen any examples of the -region option for convert. | | I thought maybe one could do something in a specific region | and then shift that area somewhere else as an alternative to | -clone and -crop for a `cut and paste' operation. | | The following successfully rotates a feature, | however the original is left in place (I was hoping the | original area may be filled with the background colour) | and I cannot see how to readily shift the feature elsewhere. | | # Rotates the region about the origin of the region | # but cannot relocate the region | | convert -size 300x200 xc:blue \ | -fill red \ | -draw 'rectangle 20,20 30,50' \ | -draw 'rectangle 40,70 50,80' \ | -fill lightgreen \ | -draw 'rectangle 20,50 30,80' \ | -region 20x60+20+20 -rotate "<-90" \ | -flatten \ | win: | Greetings from my vacation, currently Hong Kong. Region is a tricky setiing in that it only effects image operators which are not classed as 'list' operators. That is operators that do not deal with the current image list as a whole, but treat each image in that list as a separate item. That is operators like -compose -average do NOT work with a -region setting. On the other hand operators like -resize -rotate -distort -draw should work with -region. Regions work by extracting a 'virtual canvas' sub-image from the original image. This is what the operators work with. When finished the image is composited back 'over' the original image. For examples see Simple Image warping, Regions http://www.imagemagick.org/Usage/warping/#region Note that regions can cover a larger area than the original image and if the result is larger or smaller then the final overlay will not overlay the same region as the original image. Anthony Thyssen ( System Programmer ) <[email protected]> -------------------------------------------------------------------------- To err is human... to really foul up requires the root password. -------------------------------------------------------------------------- Anthony's Castle http://hobbit.ict.griffith.edu.au/~anthony/ _______________________________________________ Magick-users mailing list [email protected] http://studio.imagemagick.org/mailman/listinfo/magick-users
