Bash

Video to *good* GIF

Written by  on April 7, 2016

You can use a crappy app or some webservice … or DIY!

read: start at second 4 with length 3, use high quality-conversion, downscale (because scaling with ‘convert’ will result in artifacts because of the color-indexing), out-filename

If some rotation is needed (-vf “transpose=2” is also an option, but the quality suffered), add it afterwards via convert.

Normalize your mp3

Written by  on July 12, 2015

I use mp3gain with and without UI for several years for normalizing my collection, because I hate it when during physical education your eardrums getsuddenly blasted to bits ‘n pieces!
Yes, album-normalisation would be more “original”, but I don’t care.

Hint is taken from that page, because I lost my old bash-history.

Pos, Neg or Koda? What SF8-HDR-type does the file have?

Written by  on June 17, 2015

I needed a quick and dirty solution to automatically check for the type of the given HDR-scan. Since some custom makernotes are used, the question was how to get by using exiftool the necessary information. A quick comparison with hexdump and diff showed the difference in the binary output.

So this tiny script will return the type of the given input as exitcode (checkable in terminal via “echo $?”): 1 for positive, 2 for negative and 3 for kodachrome. 0 for errors … and yes, this negates the POSIX-semantic! I guess someone more capable could turn it into a one-liner. Nevermind: it works and this is sufficient for my usage.

posNegKod0.1.zip

createContactSheet 0.4

Written by  on June 14, 2015

Okee, sorry for the continued spam about this small bash-project, but I am a little bit excited. It turned out much more powerful than expected. I learned a lot new and really useful stuff. I am also really confident now about the future of “bash & me” 😉

I improved the latest state with an idea a good friend pointed out: why don’t you add the original file name to each thumbnail? For a better overview? This is done also by imageMagick (convert); also append now the base-directory as footer-note. Because for my workflow the dir-name is the scan-date and the emulsion-type.
Some other improvements are: changed workflow (negative-conversion on each picture instead of the whole combined one; therefore no “filling of the last row” needed); script-parameters for help and version and for suppressing the negfix8-conversion; cleaner code.

I have also some more ideas in mind, but I think for now it is enough. It was fun, but I also want to discover some other areas of IT!

Download this: createContactSheet_0.4

contactSheet_pixeled

createContactSheet 0.3

Written by  on June 13, 2015

I fixed a small glitch, which was included in the first releases: input-filenames with spaces were not treated correctly therefore no result was created. Fixed by some string-replacement and setting the IFS-variable which dictates that bash should treat spaces not as separators.
For the next release some filename-embedding into the thumbnail is planned. But this has to happen after the negfix8-conversion else it would alter the conversion itself ..

Download this: version_0.3

Small hint: git offers a really nice exporting-function which will just include the current state of the given branch:

You want a contact sheet with that?

Written by  on June 3, 2015

Slogan is like always: “If you are not ashamed of the first release of XYZ, then you waited too long or have no self-reflection.”

It would be nice to have a preview shaped like the original contact sheets of a HDR-film scan. So you could screenshot the thumbnails and print this.

Or you try the following script:

  • it takes all TIF from one directory (assuming they are HDR-scans from SilverFast)
  • creates thumbnails with a longer side of 400px into a separate directory
  • appends six thumbnails for each row and the combines all rows to a single picture. If the number of pictures does not fit, the last picture is repeatedly appended (this is necessary due to the negative conversion)
  • ‘negfixes’ them (negative conversion done by the great original script of negfix8 from JaZ99!)
  • spreads the contrast in two diffent approaches (check yourself which is your most liked version)

As a result you get something like this:

combinedSheet_negfix8_stretched1.00_scaled

As you can see: the black strips at the left and right side of the pictures still exist. But since I scan always the HDR-files with top and bottom cropped, the black borders don’t show up there. Time to change my workflow?

Download:

 HowTo:

  • download & extract the two scripts
  • open a bash-terminal an navigate INTO the directory with the HDR-scans
  • run “/PATHTOSCRIPT/createContactSheet.sh” and wait for 2 to 3 minutes

Future plans:

  • improve the structure of the code and add some more comments and make it less error-prone
  • full clean-up after the creation (by default; suppresable by param)
  • suppress the negfixing by param so also E6 (slide)-scans can be ‘contact sheeted’
  • make the script use the general temp-folder and put just the final two contact sheets into the target folder (so the data stays clean)
  • add the filename in the bottom-right as transparent overlay so you know which thumbnail belongs to which picture

 

edit 20150603: Just uploaded version 0.2 which improves performance a lot and cleans everything up and has a nicer structure!

What was your favourite command?

Written by  on June 2, 2015

It’s been a while since the last post, but I was not lazy. As you may have noticed the “nanalogue photo development-page” grew with more examples.

Here is another short classic for your shell-history*: what are your most used terminal-commands?
* If not bash, then adapt your history-path. If you did not activate the history … then it would not work 😉

Remove multiple newlines from a file

Written by  on April 29, 2015

===========================
Warning 20150507: Just noticed, that the sed-expression also filters identical “not empty” lines from you file! This is not what I wanted. So if you have code with array-initialisations which use the same lines or multiple consecutive calls of the same function, then be careful and check the result of the following command with diff!

Hint 20150508: take a look at this code-snippet. Just copy&paste&compile&run.
===========================

Task to achieve is: remove the superfluous double or triple empty lines between functions. One empty line as separator is acceptable. Two are annoying ..
Workflow is: filter the original source-file and put it into a new file. Remove the old one and replace it.

Maybe I should put it into a shellscript which parses the given directory recursively and applies this to all *., *cpp, *.hpp ..

Get an overview which SilverFast8-version was used to process your photos

Written by  on March 26, 2015

It is very interesting to see which SilverFast8-version was used for scanning and processing the photos you have digitalized.
The following crude bash-chain-command relies on the GNU-tools, exiftool and some intermedite files. It is not sophisticated or using any syntactic sugar: it just works*.

(* means: has a lot of improvement-potential)

abilities:

  • checks for exiftool first: if not available (missed the installation?), then abort
  • checks all original SF8-output-types: tif, jpg, jp2 and dng
  • searchs stupidly for the “Software”-tag; if other software touched the files that can be missing
  • collects the data into files “versions.txt” and “uniqed.txt” which are not deleted after the run!

example output:

ps. Just noticed that SF6-files are also checked correctly.