FrancoisMalan / DivideScannedImages

GIMP Scheme (.scm) script for splitting separate sub-images from a composite image that has a uniform background. Creates a new image from each; will call the 'deskew' plugin on each image (if it is installed)
111 stars 22 forks source link

Does not split white #21

Open Suncatcher opened 6 months ago

Suncatcher commented 6 months ago

I have the following set of photos on a page with pseudo-white background color, and the script does not work. It splits absolutely irrelevant small pieces from the last photo only (cuts the last photo on small pieces). All other photos are ignored by script.

e

I tried both automatic background setting and manual too, I used #F7F5F5 RGB code for manual, same useless result. Any suggestion what parameter to change?

mamipi972 commented 6 months ago

Hi there,

I used your photo in a YouTube video to demonstrate how the script works. The video is in French. You can enable automatic English subtitles to possibly understand my approach.

https://youtu.be/OX47iNf-ZI8

I hope this will be useful to you.

Sincerely,

Suncatcher commented 3 months ago

I hope this will be useful to you.

ok, that was very helpful indeed. Sorry, I missed your comment earlier. That was very helpful but I was stuck at the very first step. Supposedly I was doing everything like you with the defult settings, but my GIMP doesn't behave like on your video. Yours immediately selected all photos with selection tool and cropped them, mine did not. Take a look on my video please, I even tried to play with the manual background color, but no luck https://1drv.ms/v/s!AkIvWiEe9uUkjpp7Gj-tthmtUWxZXw?e=vUTV0f what settings I am doing wrong? It looks like everything is similar to your settings

mamipi972 commented 3 months ago

It's going to fail every time. The background must be white (#FFFFFF) to contrast with the photos. to highlight the elements. watch the video where I show the failure by doing like you. Then, i select and fill with white color after what you take in color stubbornly.

https://youtu.be/OX47iNf-ZI8?si=OiMn3LgUQYT7hmxq&t=1611

Suncatcher commented 3 months ago

OK, I spent quite a bit of time trying to create subtitles and understand what you are doing on the video. Well, the automated video transcription is shit, and it produces nonsense and unfortunately I don't know French. And without understanding your comments this video is not very helpful.

Observing your actions and previous comments here my assumption is:

  1. you are manually selecting all the background areas

image

  1. you are setting it to #FFFFFF color
  2. you run the script, and it makes distinction from #FFFFFF and non-#FFFFFF and cuts non-#FFFFFF pieces into separate photos

Anyway, doing the manual selections in steps 1 and 2 is too time-consuming and slow, and defeats the whole aim of automated script. I cannot spend 20-30 mintes on the single photo, I have hundreds of such multi-photo images. I need more automated way. Anyway, very thanks for your effort.

mamipi972 commented 3 months ago

The hypothesis is correct. I do this manipulation because the background behind the photos isn't a perfectly white color, or any color that makes the photos stand out.

If the initial preparation is done with a background that's a solid color and without any marks, it will work."

Here's a slightly more concise version, keeping the same meaning:

"The hypothesis is right. I adjust the background because it's not perfectly white, or any color that helps the photos pop.

If you start with a clean, solid-colored background, it'll work.

image