crop image which is outside

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ifkey
Posts: 8
Joined: 2018-08-23T11:50:07-07:00
Authentication code: 1152

crop image which is outside

Post by ifkey »

Help me how to crop an image that goes beyond the frame.

Image

if I change the size then nothing comes out
source file https://drive.google.com/file/d/1bsjy3N ... 7H0da/view

Code: Select all

convert *.tif -resize 1000x1000 test.tif
Image
Last edited by ifkey on 2018-08-23T14:16:45-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: crop image which is outside

Post by snibgo »

Your posted image, sc1.png, seems to be a screen shot of some software that is displaying some image, possibly 1.tiff. If so, please post the actual image, not a screenshot of it.
ifkey wrote:...an image that goes beyond the frame.
I don't know what that means. A raster image cannot have any pixels outside its own boundary.
snibgo's IM pages: im.snibgo.com
ifkey
Posts: 8
Joined: 2018-08-23T11:50:07-07:00
Authentication code: 1152

Re: crop image which is outside

Post by ifkey »

snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: crop image which is outside

Post by snibgo »

That tif file contains two images. So when you process them with IM, you will often get two outputs. Use [0] or [1] if you want to process just one image.

The first is fully opaque, but the second has transparency.

So, what do you want to do with those images? Or with just one?

Also, what version of IM do you use, on what platform?
snibgo's IM pages: im.snibgo.com
ifkey
Posts: 8
Joined: 2018-08-23T11:50:07-07:00
Authentication code: 1152

Re: crop image which is outside

Post by ifkey »

ImageMagick-7.0.8-10-Q16-x64-dll

how did you determine that there are 2 pictures?

I have 1 layer in this file.
I want to batch file preparation for printing, and I want to configure so that if such files come across that they could also be processed in batches.
In Photoshop, you can delete the superfluous image, can you do it in the IM?
Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: crop image which is outside

Post by fmw42 »

Your tif file has a virtual canvas that provide the outside area. You can remove that by

Code: Select all

convert 179.tif +repage -resize 1000x1000 test.tif
ifkey
Posts: 8
Joined: 2018-08-23T11:50:07-07:00
Authentication code: 1152

Re: crop image which is outside

Post by ifkey »

Does not help, the same result
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: crop image which is outside

Post by fmw42 »

I am sorry, but I do not understand the issue. There is no outside of the main image if +repage is used. Please clarify. How do you see any outside region? What was your ImageMagick command and post your resulting image.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: crop image which is outside

Post by fmw42 »

You have a tif with 2 pages. Try this

Code: Select all

convert -quiet 179.tif[0] +repage 179_0.tif
convert -quiet 179.tif[1] +repage 179_1.tif
Are either of these what you want? My guess is that you want 179_0.tif
Post Reply