Not sure if this is a bug or if changes in implode or how region works in IM 7
Any idea on what's going on or how to fix?
flower.jpg
convert -region '150x150+50+50' -implode 1 flower.jpg out.jpg
IM 6 out.jpg (desired)
magick flower.jpg -region '150x150+50+50' -implode 1 out.jpg
IM 7 out.jpg ( notice box effect)
implode region in IM 7
Re: implode region in IM 7
See https://imagemagick.org/script/porting.php:
-region: This option sets a write mask for the region you define. In IMv6, a separate image was cloned instead, operated on, and the results were composited to the source image. In addition, the draw transformations are relative to the upper left corner of the image, previously in IMv6 they were relative to the region.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: implode region in IM 7
Thanks. Is there a workaround other than compositing with a mask image?
Re: implode region in IM 7
Sure, you can clone the image, operate on it and composite the results back to the source image. This is exactly what IMv6 does, -region was simply a convenience to do all the operations with one -region option.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: implode region in IM 7
These are equivalent. (Note proper IM syntax -- read the input first)
Code: Select all
convert flower.jpg -region '150x150+50+50' -implode 1 +region out.jpg
Code: Select all
convert flower.jpg \
\( -clone 0 -crop '150x150+50+50' +repage -implode 1 \) \
-geometry +50+50 -composite result6.jpg
Code: Select all
magick flower.jpg \
\( -clone 0 -crop '150x150+50+50' +repage -implode 1 \) \
-geometry +50+50 -composite result7.jpg