Hi everyone,
I'm trying to do a simple images process, but my level of english and programing is low and is hard for me understand the imagemagick guide. I reviewed Fred's ImageMagick Scripts and neither found any solution.
I want to cut an image with a mask. This is my flow program
1 receive the image to mask and it's size
2 place the mask in the position that i want over the image
3 apply the mask to cut the shape
4 merge the result in other image on the desire position
I want to extract only the shape of the mask. I move the mask because in my image the original is bigger or smaller that mask(the image size to mask will change dynamically ), in case the size of image and mask be the same i don't move nothing.
In this case the mask cut all rose, but some tome i want cut only a part of the rose, for that move the mask to area to crop.
What can i do?
P.D:
My O.S is ubuntu and imagemagick version is:
Version: ImageMagick 6.8.9-9 Q16 x86_64 2015-08-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib
how to crop an image with a mask
how to crop an image with a mask
Last edited by andreiya on 2016-01-26T14:15:43-07:00, edited 3 times in total.
Re: how to crop an image with a mask
Your last 3 mages are not displayed - need to change the privacy settings on dropbox?
Re: how to crop an image with a mask
The images are public and I saw fine in the posting previewBonzo wrote:Your last 3 mages are not displayed - need to change the privacy settings on dropbox?
I have reupload to imgur and I hope that works.
P.D: I visited your page, It 's fine, thanks for sharing
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: how to crop an image with a mask
I think you want to make some pixels transparent. Where the mask is black, make them transparent. Do this with "copy-opacity", for example:andreiya wrote:I want to cut an image with a mask.
Code: Select all
convert rose: mask.png -compose copy-opacity -composite out.png
snibgo's IM pages: im.snibgo.com
Re: how to crop an image with a mask
Thanks snibgo, I´m going to sleep. Tomorrow try your advice and repost
Re: how to crop an image with a mask
Thank youP.D: I visited your page, It 's fine, thanks for sharing