Hello,
We have like more then 5000 pictures to trim around picture.
Does anybody have the right settings for this?
Here you have a difficult example from one picture...
Auto Trim white objects
Moderators: helmut, XnTriq, xnview
Auto Trim white objects
- Attachments
-
- 351044_08.jpg (133.07 KiB) Viewed 2511 times
Re: Trim white objects
Do you mean autocrop? ALT-Y
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)
Re: Trim white objects
> We have like more then 5000 pictures to trim around picture.
COOL
> Here you have a difficult example from one picture...
I'm getting best results with Tolerance 21 ... but AutoCrop is not smart ... you have to find out the background color (here white, no problem) and the tolerance (big problem: here 27 is too much already) yourself.
COOL

> Here you have a difficult example from one picture...
I'm getting best results with Tolerance 21 ... but AutoCrop is not smart ... you have to find out the background color (here white, no problem) and the tolerance (big problem: here 27 is too much already) yourself.
- Attachments
-
- crop128.jpg (27.95 KiB) Viewed 2503 times
There is indeed no WinZIP under my rock.
Re: Trim white objects
Hmm, I wonder whether the background colour could be determined automatically by XnView.
Auto-colour and Auto-tolerance
If a user applies automatic crop, he/she indicates/knows that there is a surrounding background and an object in the image. Otherwise, triggering auto-crop would not make sense.
Given the above assumption, both colour and tolerance could be determined automatically by XnView inspecting all border points of the image. The auto-colour would be the average out of all colours. And the auto-tolerance would be the tolerance found in the colour values of all border pixels.
Applying auto-crop to an image multiple times with auto-colour and auto-tolerance would end up in a mess. To avoid this, reasonable maximum values might help.
Currently, auto-colour and auto-tolerance in auto-crop are not supported. These are just some first thoughts how this might work. Probably much more thinking and even trial-and-error would be needed to make this really fly.
Auto-colour and Auto-tolerance
If a user applies automatic crop, he/she indicates/knows that there is a surrounding background and an object in the image. Otherwise, triggering auto-crop would not make sense.
Given the above assumption, both colour and tolerance could be determined automatically by XnView inspecting all border points of the image. The auto-colour would be the average out of all colours. And the auto-tolerance would be the tolerance found in the colour values of all border pixels.
Applying auto-crop to an image multiple times with auto-colour and auto-tolerance would end up in a mess. To avoid this, reasonable maximum values might help.
Currently, auto-colour and auto-tolerance in auto-crop are not supported. These are just some first thoughts how this might work. Probably much more thinking and even trial-and-error would be needed to make this really fly.
Re: Trim white objects
> both colour and tolerance could be determined automatically by XnView
not really
> inspecting all border points of the image. The auto-colour would be the average out of all colours
no problem
> And the auto-tolerance would be the tolerance found in the colour values of all border pixels
This won't work. A few almost invisible dark noise pixels at the border will enforce a high tolerance eating up parts of the valuable image (see above).
> Applying auto-crop to an image multiple times with auto-colour and auto-tolerance
> would end up in a mess. To avoid this, reasonable maximum values might help.
Can't reproduce this.
not really
> inspecting all border points of the image. The auto-colour would be the average out of all colours
no problem
> And the auto-tolerance would be the tolerance found in the colour values of all border pixels
This won't work. A few almost invisible dark noise pixels at the border will enforce a high tolerance eating up parts of the valuable image (see above).
> Applying auto-crop to an image multiple times with auto-colour and auto-tolerance
> would end up in a mess. To avoid this, reasonable maximum values might help.
Can't reproduce this.
There is indeed no WinZIP under my rock.
Re: Trim white objects
Suggestions: visual batch crop
Content-aware cropping:
Content-aware cropping:
Peter Sobot ([url=http://www.petersobot.com/blog/a-use-for-smartphone-photos/]A Use for Smartphone Photos[/url]) wrote:Michael Macias, in a submission to a Codebrawl last November, came up with a brilliantly simple method of content-aware image cropping. By measuring the greyscale entropy of a window as it slides over an image, the highest-interest thumbnail can be determined automatically.
Re: Trim white objects
Hmm, I can't see why this shouldn't work. If you have dark noise pixels at the border, then auto-crop the way it works now is at a loss anyway, even when setting both colour and tolerance values manually, isn' it?DOS386 wrote:>> And the auto-tolerance would be the tolerance found in the colour values of all border pixels
>This won't work. A few almost invisible dark noise pixels at the border will enforce a high tolerance eating up parts of the valuable image (see above).
I'm pretty sure that there is a way to automate this and to achieve a good result for images with a background like the ones shown above.
@XnTriq: Thanks for the links. I had a look at the sample pictures of Michael Macias and found the sample results not overwhelming. Yet, I guess the sample pictures were very difficult for automatic cropping. I assume with above sample image (sport shoe) and similar images the results would be reasonable.
Re: Trim white objects
Croppola's output of 351044_08.jpg is also disappointinghelmut wrote:@XnTriq: Thanks for the links. I had a look at the sample pictures of Michael Macias and found the sample results not overwhelming.

I'm confident, though, that algorithms for content-aware cropping will eventually be improved.
If the Gamma (Image » Adjust » Brightness/Contrast/Gamma/Balance...) of 351044_08.jpg is decreased, it becomes apparent that the shoe was placed on a turntable. This leads me to the conclusion that all/many of mrbombay's 5K product photos may well have been shot under the same or similar conditions.
Batch-cropping seems to be a viable option in this case.
- Tools » Batch Processing... » Transformations » Image » Crop
- X [ 250 ]
Y [ 150 ]
Width [ 720 ]
Height [ 540 ]
- X [ 250 ]