Everything understood! - works wonderfully
Sorry, I had an unexpected visit from my daughter and couldn’t get to my PC. Yes, the color picker and the whole dialog box are working. Unfortunately, my ImageMagick isn’t working properly; I built it myself, but apparently not correctly (even though I’ve done this many times before with success). That’s why nothing is showing up in the pictures with label folder. Unfortunately, there is no ready-made deb package with imagemagick 7* available. But that doesn’t matter. Everything works in Manjaro, I know my way around. I just need to enlarge the partition so I have space for the photos, but that’s no problem.
I think we can close this monster thread now. I would like to express my warmest thanks to everyone who has put so much time, energy, knowledge, patience, and kindness into this task. Not only is my work now much more comfortable and faster than before, but I am also particularly happy to have had the opportunity to meet people of this caliber. It gives me hope that not everything is going down the drain in this beautiful world after all.
Thank you and all the best!
So maybe sometime after Tooth Hurty?
@hech, @skyfishgoo
One last thing:
I don’t want to start a new thread – I think it’s better to tell you this:
digiKam is a good program and it also has a text tool. It is possible to choose the font color with Kcolorchooser, but not the text background. The only options are no background or a semi-transparent background. That’s not practical. For the font color, the choice between black and white is completely sufficient; the background should be selectable from the photo using the color picker. Perhaps one of you, who are much more knowledgeable than I am and can explain it much better, can suggest this to the developers of digiKam. I probably won’t need it, as the script works great and fast (I estimate 30-40% faster) for me, except in a few cases (photo already has a label, e.g., copyright; bottom left is occupied).
i don’t use digikam (far too complex for anything i would need) but it would make a good feature request for anyone familiar with the application to start one on bugs.kde.org
this script has proved to be handy for me and i’m currently improving my copy to add a couple more features to it like preview of the label before commit, and the ability to choose the location so you can have multiple labels on a single pic.
might even create a settings editor so you can edit a text file to control the font, fontsize, line spacing, and padding
was also thinking ultimately a service menu for the script so you could just right click on a folder of pics and run the script on it… there could even be a one-off variant where you right click an individual photo and add labels to it.
I sometimes have to post-process raw files, so I’ve tried out various programs; most of them are good, but GIMP, which can do the most, is still too cumbersome for me. I prefer to do this work with Darktable. It’s a really good, well-designed and cleanly programmed program. I’m always amazed that such programs are available for free.
Your extensions to the script are exciting! I get along very well with @hech’s script: I first sort out the photos that I want to edit with the script and load them into the pictures folder, and then I use xnview for the remaining photos that need more individual editing. This works wonderfully.
As for digiKam: maybe a digiKam developer is reading this thread.
@hech, @skyfishgoo: if you come to Europe and want to see the wonderful area around Lake Constance (4 countries: Austria, Germany (10 min), Switzerland (20 min) and Liechtenstein (25 min)), there’s always a couch free for a few days. Can you reach me by email?
That’s right, the difference between bash
shell and sh
(the ‘vanilla’ POSIX shell) was revealed in how the script was called. The original script was fine for bash
and had its shebang line #!/bin/bash
so when you call the script directly ./label-on-pictures.sh
, all is good [apart from missing magick
binary]. But when you call sh label-on-pictures.sh
you ignore the shebang and execute the script with sh
, which doesn’t understand the double-bracket or double-equals syntax particular to bash
.
[Fun trivia: [[
is a command built-in to bash
, whereas [
can be built-in but is normally found as a stand-alone binary /usr/bin\[
(or symlink to /usr/bin/test
) that any shell can employ.]
bash
has a few other nice features over plain sh
so for my own script needs I always just write in bash
syntax, and save with .bash
extension to avoid any doubt.
@hech hate to bother you, if you have any tips for how to improve the quality of the text labels using imagemagick, i would love to hear it.
not sure what has happened, but label quality seems to have degraded since my original pic, particularly with the green text.
i’ve figured out that using .bmp or .png for the label file works marginally better and some fonts are worse than others but if there are any other “magic” bullets you can think of for me to try, i would be grateful.
also tried using larger font and then resizing the image back down to the same size and it still looks the same… i guess i should have expected that one
if not, then i’m sure i’ll figure something out and thanks for inspiring me to delve into this scripting business… it’s challenging but fun (if a bit slow).
just to follow up on my own post, after searching thru many different fonts for the least blurry and playing with -sharpen and bunch of other stuff.
the answer was so simple.
don’t use .jpg for either the label creation OR the final product output.
here’s the difference with
final image saved as .jpg
vs.
final image saved as .png
the difference is astounding, but since this website down converts everything to .jpg automatically the difference shown is not a stark as it is on my screen so i blew up one corner to highlight the difference