Page 1 of 1

Feature request: Auto-crop image

Posted: Tue Mar 17, 2015 8:23 pm
by magick
The only reason I still have IrfanView installed (therefore limited to win32 sandbox)…

I can think of two possible extension options:
- trim from selected frames only (top, bottom, left, right)
- trim when pattern changes (rather than detecting first if pixels adjacent to the frame have the same color and then detecting how wide the same area towards the centre is - this would be detecting just the break in the pattern so therefore could support multiple different colors initially adjacent to the frame. For instance, image:

Code: Select all

RRRRRGGGRRRRRRRR
RRRRRGGGRRRRRRRR
RRRRRGGGRRRRRRRR
RRRRBGGRRRRRRRRR
RRRRBGGRRRRRRRRR
RRRBBBGGRRRRRRRR
RRBBBGGGGRGRRRRR
RBBBBBBRRRRRRRRR
would result in:

Code: Select all

RRRRBGGRRRRRRRRR
RRRRBGGRRRRRRRRR
RRRBBBGGRRRRRRRR
RRBBBGGGGRGRRRRR
RBBBBBBRRRRRRRRR
when crop from top only.

and in:

Code: Select all

 RRBBBGGRRR
 RBBBGGGGRG
 BBBBBBRRRR
when crop from all directions.

whereas default trim (like in IrfanView) would result in:

Code: Select all

 RRRRGGGRRR
 RRRRGGGRRR
 RRRRGGGRRR
 RRRBGGRRRR
 RRRBGGRRRR
 RRBBBGGRRR
 RBBBGGGGRG
 BBBBBBRRRR
(just left & right as those had one a same R-color adjacent to the frame initally)