Automating cropping of Film Scans from Flatbed

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
TedBaker
Posts: 36
Joined: 2017-10-10T14:14:55-07:00
Authentication code: 1151

Automating cropping of Film Scans from Flatbed

Post by TedBaker » 2017-10-10T15:53:24-07:00

Problem: Flatbed scanner can't only scan one image at a time, (Epson)

Solution: Scan the entire flatbed 27360x43680 px and post process.

Now I have a new problem, automate the post processing:

New Problem:

A scan with 4 strips of film in black holder, there is sometimes a transparent edge of the film between the holder and the frame. The gap between frames on the strip is always visible on the scan.

Desired result:

1. crop the image into 4 strips removing all of the film holder masks
2. crop each strip so that some of the transparent edge between frames remains, 20px should be fine
3. Invert each frame

So far I have used MULTICROP to achieve some of number 1.
A bit struck on number #2
#3 I am using negfix8

So looking for any help solving points #1 and #2

User avatar
fmw42
Posts: 22101
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Automating cropping of Film Scans from Flatbed

Post by fmw42 » 2017-10-10T18:02:09-07:00

Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at viewtopic.php?f=1&t=9620

For novices, see

viewtopic.php?f=1&t=9620
http://http://www.imagemagick.org/scrip ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/

Please post and example image and your command line for using my script, multi crop. You can upload your image to any free hosting service such as dropbox.com and put the URL here.

Also see my scripts, negative2positive and neg2pos for inverting your negs and color correcting.

TedBaker
Posts: 36
Joined: 2017-10-10T14:14:55-07:00
Authentication code: 1151

Re: Automating cropping of Film Scans from Flatbed

Post by TedBaker » 2017-10-11T06:23:22-07:00

I uploaded a scan, https://ibb.co/hYwi6G

I modified the images as I don't have permission to publish the full pictures but you can see the mask, the transparent areas around the film clearly.

I am using ImageMagick 6.8.9-9 Q16 x86_64 2017-07-31

The default for multi crop work pretty well as a first pass.

#multicrop -u 3 in.tif out.tif

User avatar
fmw42
Posts: 22101
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Automating cropping of Film Scans from Flatbed

Post by fmw42 » 2017-10-11T10:45:55-07:00

Multicrop should be able to extract each of the strips. To separate the images in the strips, assuming you know the number or the size, you can use -crop. See
http://www.imagemagick.org/Usage/crop/#crop_tile
http://www.imagemagick.org/Usage/crop/#crop_equal

TedBaker
Posts: 36
Joined: 2017-10-10T14:14:55-07:00
Authentication code: 1151

Re: Automating cropping of Film Scans from Flatbed

Post by TedBaker » 2017-10-11T12:43:23-07:00

Thanks, I those should do.

My goal is speed up the scan process at least 4x as the scanner software does not have the smarts to scan and the crop AFTER.

Will post my completed scripts as this should be useful for other users.

Where is place to ask questions about scripts like negative2positive? I am trying to understand what it does exactly in terms of how it drives imagemagick?

User avatar
fmw42
Posts: 22101
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Automating cropping of Film Scans from Flatbed

Post by fmw42 » 2017-10-11T12:53:29-07:00

Post to Fred's Script's forum.

Post Reply