2.36: AutoCrop does not work

Bugs found in XnView Classic. Please report only one bug per topic!

Moderators: XnTriq, xnview

Post Reply
therealjoeblow
Posts: 4
Joined: Tue Dec 27, 2011 8:16 pm

2.36: AutoCrop does not work

Post by therealjoeblow » Fri Sep 02, 2016 3:31 pm

I have an image that has a white background, a solid black company logo in the middle, and a medium-thick consistent width black border around the whole thing.

When I initiate auto-crop, select the border with the eyedropper as the background color, and set tolerance to 255, it does nothing.

If I set tolerance to any other value, even down to 1, it still does nothing.

If I set background color to white instead of black, it still does nothing, for tolerance =255 or =1 or anything in between.

Essentially autocrop does exactly *nothing* with any settings.

Should it not just very simply clip off the black borders and leave the logo on a white background in the middle of the image?

Cheers
TRJB

therealjoeblow
Posts: 4
Joined: Tue Dec 27, 2011 8:16 pm

Re: AutoCrop does not work

Post by therealjoeblow » Fri Sep 02, 2016 3:48 pm

Nevermind, I found that there was a 1 pixel grey border around the thick black border that couldn't be seen at normal zoom levels which was somehow stopping the routine from working.

I coarsely manually cropped to just within the thick black border, and then the autocrop routine worked fine with the background set to black.

Perhaps the routine could be made more robust and fail-safe by adding a parameter to help it detect something like this; IE, some additional tolerance setting to start looking for the "real" border to crop 2 or 3 pixels from the edge, and ignoring the phantom odd colored pixels right at the edge?

thanks
TRJB

cday
XnThusiast
Posts: 2155
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: AutoCrop does not work

Post by cday » Fri Sep 02, 2016 4:57 pm

therealjoeblow wrote:Nevermind, I found that there was a 1 pixel grey border around the thick black border that couldn't be seen at normal zoom levels which was somehow stopping the routine from working.

I coarsely manually cropped to just within the thick black border, and then the autocrop routine worked fine with the background set to black.

Perhaps the routine could be made more robust and fail-safe by adding a parameter to help it detect something like this; IE, some additional tolerance setting to start looking for the "real" border to crop 2 or 3 pixels from the edge, and ignoring the phantom odd colored pixels right at the edge?

thanks
TRJB


Yes, ideally autocrop functions would have a 'sensitivity' setting to come c!oser to what the human brain can achieve in recognising the desired place to crop... But possibly a challenging algorithm to design?

Post Reply