Author Topic: The Contraption 26: The Bit Booster  (Read 6446 times)

Francois

  • Self-Coat
  • *****
  • Posts: 15,785
The Contraption 26: The Bit Booster
« on: March 07, 2020, 09:23:00 PM »
They say that necessity is the mother of invention. Well this one is definitely the case.
Most of you know that I have two scanners. One is an Epson flatbed and the other one is a cheap instant scanner that uses a small fixed focus camera to sent the images to an SD card. While I like the Epson, I really love the cheap scanner. It's fast and does a decent enough job most of the time. But I did say most and not all the time. When I scan negatives that are under/over exposed, it plays havoc with the internal software, and that's a problem. I often get images that need a lot of work on the levels in order to produce something. And then, I end-up with an histogram that looks like a comb with missing teeth. The image is gritty and not pleasant to look at. I know I should have used the Epson and scan in 48 bit color, but this is slow and it p***** me out. So I had to come out with a new solution.

I started to think that one way would be to get the computer to artificially generate the greater color range. That would be definitely faster than a re-scan and possibly be just what's needed. But how to do this? Well it got me thinking about some guy I read about a long time ago who scans everything in 24 bit color at maximum scanner resolution for fast scans and then converts the image to 48 bit color before doing a bicubic resize to generate the missing tones. So I went that way. In the process of experimenting, I discovered that you don't need to cut as much into the image resolution as I first thought. To my surprise, a 99% resize it all it really takes, so I was getting into business.

But while Photoshop is all nice and good, it's big, slow and unwieldy for such a task. I wanted something small, fast and nimble. And since I love little programs that do only one thing but do it really well, I decided to write it using a windows batch script. But since scripts have no image manipulating possibilities, I decided to go for something small and powerful: ImageMagick.

ImageMagick is a command line image manipulation program that is a bit of a pain to use but incredibly powerful. It comes from the Linux world, is open source, free and available for Windows and Mac.

So, this is what I needed. Perfect.

I just added a bit of coding, some magic ingredients and I now had the perfect script.
It supports drag and drop of a single folder or multiple JPEG files. Does all the operations and saves the files as TIFF files. And best of all, it works wonders when it comes to extreme histogram compressions. There is a routine at the start that checks if ImageMagick is installed. If it is not, you get a warning and your browser opens to the ImageMagick.org website just like by magic. It's even got a color splash screen when it runs on Windows 10... a feat in itself.

For those who want to give it a try, here's the link to my Google Drive. https://drive.google.com/open?id=1hb3evaz43Y-t_Vj0OVL50MDsZ8NovPt4
It is only 3.31kb big, so you won't bust your monthly bandwidth.

Enjoy!
Francois

Film is the vinyl record of photography.

jojonas~

  • Self-Coat
  • *****
  • Posts: 2,928
  • back at 63° 49′ 32″ N
    • jojonas @ flickr
Re: The Contraption 26: The Bit Booster
« Reply #1 on: July 15, 2020, 06:07:20 PM »
I don't really get it but I'll give it a try. I've got a super shitty scanner so it would be nice if I could get something atleast half way decent out of it with this.

I get this, so I guess I need the magic thingie
Active code page: 65001
'magick' is not recognized as an internal or external command,
operable program or batch file.
/jonas

jojonas~

  • Self-Coat
  • *****
  • Posts: 2,928
  • back at 63° 49′ 32″ N
    • jojonas @ flickr
Re: The Contraption 26: The Bit Booster
« Reply #2 on: July 15, 2020, 06:16:15 PM »
or is it hopeless with something like this?


restart by jonas lundström, on Flickr
/jonas

Francois

  • Self-Coat
  • *****
  • Posts: 15,785
Re: The Contraption 26: The Bit Booster
« Reply #3 on: July 15, 2020, 08:53:35 PM »
Not hopeless. You need to install Imagemagick first https://imagemagick.org/index.php

When you input the unadjusted image it will shrink and create the intermediate tones...

I'll have to see if I can't improve the script a bit...
Francois

Film is the vinyl record of photography.

Francois

  • Self-Coat
  • *****
  • Posts: 15,785
Re: The Contraption 26: The Bit Booster
« Reply #4 on: July 16, 2020, 05:01:01 PM »
I noticed that an older version of the script was on the google drive, so I updated it to the current one.
The script definitely needs Windows 10 to work (I added escape codes to put in nice colors), I'll have to see if I can't put in a routine to identify the OS and give the proper warnings.
Francois

Film is the vinyl record of photography.

Francois

  • Self-Coat
  • *****
  • Posts: 15,785
Re: The Contraption 26: The Bit Booster
« Reply #5 on: July 16, 2020, 11:09:17 PM »
OK, now the script checks the OS version first, then it checks if Imagemagick is installed. It gives you all the appropriate error messages.
For the OS, it checks that Windows 10 is installed. The program should work with earlier versions but you need to edit it manually and remove the color esc codes.
And if imagemagick is not installed, it should give a warning and take you to the Imagick website if the browser is open.

Also, you can choose the shrinkage level you're looking for. The greater the shrink the greater the tonal scale (in theory).
Francois

Film is the vinyl record of photography.

Francois

  • Self-Coat
  • *****
  • Posts: 15,785
Re: The Contraption 26: The Bit Booster
« Reply #6 on: September 28, 2020, 06:23:06 PM »
Big Update

I've updated the ImageMagick detection part of the script. Now it doesn't crash if it's not present.
https://drive.google.com/file/d/1hb3evaz43Y-t_Vj0OVL50MDsZ8NovPt4/view?usp=sharing
Francois

Film is the vinyl record of photography.