Image processing

Tutorials >

Image enhancing and tagging options in Linux


This was written a few years back, so there might be some inaccuracies now as I haven't used any of these app's since.

 Application  Pro's  Con's
gwenview
  • with kipi-plugins there are many enhancing tools
  • batch conversion and resize dialogues can run at the same time as each other
  • folders are treated like as with a file browser, can move etc
  • need to have ability to make any plugin on the drop down menu into a button -at left
  • the dialogue from resize on left does not include quality bar but the one from plugins does!
  • drop-downmenus and chevrons are pits.
  • converting images (batch) you can't send to a "new" dir that hasn't been made (compare Picasa!)
  • no keyword tagging








digikam 2.6
  • assigning tags -with right-click select RECENT or from the caption/tag side panel -can just select tags and then select other images (or press Space if in View mode) and tags are applied (with auto apply enabled)
  • search tagged photos -click on tag filter at left sidebar (clipboard icon) to search any tag (or multiple) through all albums, or from the filter at right sidebar to search any tag of the selected album
  • searching albums is fast
  • properties at right are very full
  • rating with 1-5 stars and 9 colours, 3 flags
  • first/last image with bottom right buttons or home/end
  • geo-location tool is very cool, with marble or google maps, show two maps, drag images to the map
  • Maps (in center) show geotagged images as groups showing image count, which divide as you zoom in
  • select a geotagged image and hit M and the image's group is selected
  • edit window is full of options -drop down menu item opens to the side, scroll button on value, choose view of before/after 
  • add images to a queue for conversion/resize/edits -just drag a Batch tool into the Assigned tools box, adjust the tool, choose whether to overwrite files or make a new album, and Run it (add the Queue icons to the tool bar)
  • upload to Picasa web albums is smooth -use shortcut key (reassign F3 to Picasa export) to send selected images (but needs click on Start again for newly sent to upload)
  • Can make a slideshow of an album that shows through all its child albums
  • Full size preview, when zoomed in, the next image stays at the same zoom level
Albums
  • can't find Sort Albums in View menu (so categories is a redundant feature), and no themes are present except Default (Digikam 2.6)
  • different collections show together under My albums -can't switch between them to show different sets of albums
  • can you do native searches/tag filter in each collection without results showing for all "My albums"? no, filter includes ALL collections
  • "My Albums" under "My Albums" is redundant, why not just show collection names?
  • no Album Category chooser
  • cannot add images to a new album that is not a directory, can only move them -needs to have photo boxes in which to add images to regardless of album location (similar indeed to color labels, but then can have boxes button on sidebar).
  • where is the waste bin? or undo send to waste? KDE I guess which I don't run.
Tags
  • scrolling tags in the right sidebar is extra work.  Better if they make columns so that all are easily visible: the scroll button skips through columns. 
  • Why the huge icon by each tag?
  • clicking on tag check box is more figity than selecting a tag by clicking on its name! So name-buttons?
  • in view mode the tags attached to an image are not shown under the image, only in the sidebar (and can be hidden there)
  • no shortcut key for tags tab on right panel
  • why "My Tags" under "My Tags" ?? New tag "/tag" goes under "My Tags" not as another top level tag
  • cannot edit root tag name!  Or root album name.
  • need multiple select tags (or tag manager) to sort them out
  • tag shortcuts are worthless -how do you do that with 50 or so?  BUTTON NAMES would be nice.
Edit image
  • edit -can make toolbar buttons but need to open for every next picture, doesn't stick open at the side -make shortcuts to open them quickly. -but a lot nicer if there was B-C-G sliders next to image in View mode.
  • as with Gwenview, if you make a mistake in a batch process dialogue (from right click menu), you have to close it and re-open it to try again.
  • there's no right-click on an album and add to a queue, batch process has less-features.
Preview
  • can't progress images with scroll button in view mode -can by pressing Shift -scroll button is used when zoomed in, to scroll up/down, but why not give a user option to progress?
  • can't set the background colour (but can in edit dia) -I rely on gnome color chooser which I open and click apply every time I use Digikam.
Side panels
  • the side panels can't be shrunk between a fixed width and zero.
  • side panel needs to "go away" by clicking the thumbnail-side border (at center, a button on it) clicking the button at far left is not exactly on-the-way -a shortcut key can open the panel, but it can't hide it. Needs hide panel shortcut. -I use F to go full screen often and I have "1Star' and "No Star" buttons on the toolbar.
  • right panel uses horizontal scroll bar because content can't fit in narrow size -just makes more work, for example to clear the tag entry field with clear button at right.
  • color labels on caption/tag side panel are on drop-down list -not the same as the filter bar! Better to have them all shown, there aren't many to show.
  • a NONE button on the filter sidebar? -on bottom bar at center, "Reset all active filters".
Batch
  • the "close" button in Export to Picasa Dialogue stops the upload -Alt-Tab to return to Digikam window
  • Batch Process (rightclick on album) dialogue can't create a dir that doesn't exist and also gives no second chance, only to close it.
Geolocating
  • Search panel affects only the left-hand map? Need for a focus feature when using two maps side-by-side, so that the search panel can affect either map.
  • two-map buttons (horizontal, vertical) and one map button would be better than a Preference dialogue
showfoto
  • full of image enhancing tools all accessed from the menu bar (tools from digikam)
  • good for quick work on just a few images
  • nice tool tips info of images
  • no importing or organising of albums
  • no batch queuing or editing supported
  • another white-background image gallery!!
gthumb  
  • tagging is only by right-click, not available in left-hand panel
  • resize/conversion has no quality option -it's set in Preferences
F-spot
  • a photo-tagging browser tool and that's all
  • folder tree is ancient and tedious for expanding
  • has basic editing -but need to select tool for every pic, doesn't stick (ie not like Picasa)
shotwell 0.14
www.yorba.org/...
  • organises images by event as well as folders (in latest version)
  • uploads to quite a few web image hosting services
  • sorts by tags
  • various tools
  • very slow response time and eats the cpu due to constant checking of library
darktable 
  • looks nice
  • batch tagging and resizing? don't think so
kphotoalbum
  • has only organising, which I don't need as everything I have is already in sorted directories
XnView MP 6.9 
xnview.com..
  • nice interface -everything is customisable with settings and css sheet - file caption detail, tooltip detail, thumbs bg color, moveable panes and ability to save five layouts
  • thumbs can be close together (minimal blank space)
  • many tools for image enhancement (rotate, flip, crop, resize, BCG, rgb, HLS in the view tab, plus all the effects in batch convert dialogue)
  • easy writing keywords to images via Categories pane (tree) or by selecting from Category sets, also right-click edit IPTC of multiple images is possible
  • can mark images with rating 1-5 star or color, also can tag images (set a "check") and then select/filter all tagged for temporary work
  • building thumbnails is very fast business and the database doesn't get very large (it used to get to over 5GB !  But now with better cataloging and much smaller file size of webp format thumbs, it stays under 1gb, even at 400mb if optimizing is done)
  • resize dialogue shows "after" image with file size
  • Categories can't search individual folders and filter/ search gets canceled by moving to another folder
  • geotagging seems to be absent and geo-coordinate editing not possible in Exif properties dialogue
  • can't upload to Picasa Web Albums
  • there's no progress bar when applying categories (keywords) to many images (I depend on my laptop's hdd lamp!)
  • new folders don't show up in the folder tree
  • lots of tools still to be re-added from XnView the predecessor of MP
  • can drag and drop files to the folder tree but not the Favorites tree
  • no albums as yet



Using Digikam



My Digikam Assigned Shortcuts


(can also add toolbar buttons)

 V  View Image - for ease of opening and returning to thumbnails  Alt-A   Invert selection    
In Edit
 M  Maps  2   Forward (browser style)   T  Show/hide the thumbbar
 T  Thumbnails  1   Backward   1  Brightness/contrast
 C
 or Space or Shift-scroll button
=next image
 F1   Export to Picasa Web Albums    2  Hue/saturation
 Z
 or Shift-Space =Previous image  F2   Geo-location tool   Ctrl-X  Crop to selection
 >  Zoom in  F3, N   Rename   Esc  closes the tool panel
 <  Zoom out  F   Fullscreen toggle    F4  closes edit window
 A  Open Albums on left panel  Q   Add to current queue      
 G  Open Tags on left panel  W   Add to new queue     Light table
 L  Open image on Light table  Ctrl-Q  Open batch queue manager   L  close the window 
 S  gpS, open image(s) in Geolocation tool        





Select pics across multiple albums


  • easy as selecting images and assigning a "color label" to them (keep at least one color for temporary use) or a star
  • do this for images in different albums that you want to select together
  • then use the filter on the right bar to show only the images you just labeled (you will need to check View > Group Images > Flat list)
  • then select them all (click on the title bar) and do as you wish -tag, send to a queue, export to we album etc
  • alternatively, add images from different albums to a single queue -but what if you want to add them all to another queue, or start over again?


Tips


  • Add Views icon to toolbar -use it to select how an album with child albums shows thumbnails, divided at albums or a flat list (all images together alphabetically)
  • Add "1 Star" and "No Star" buttons (can rename the text on them) to the toolbar -or whatever color labels you like.
  • Group thumbnails: drag an image thumbnail onto another one to group them together (or select multiple and right click >Group >group here), click the group icon on the top one to show them, click again to hide, right click 'ungroup' them -this is a way to group images in an album of the same view or place for example.
  • add the Maintenance icon to the toolbar -use for scanning new images to the albums.
  • edit images with "Enable non-destructive editing and versioning" checked in Configure so that originals will be kept.
  • add the thumbnails button to edit/light table windows.
  • in edit window add the Select Tool button for a quick tool selection drop-down.


Geo-Tagging



1. Geo-location filter at left pane, shows a map integrated with either kde's marble (world globe) or with G maps shows groups of geotagged images on a map with count of images,
  • group divides into smaller groups as you zoom in
  • click on a group and its images' thumbnails are shown in centre pane
  • >>rectangle select: click-drag area to select multiple groups
  • images can be sorted youngest/oldest shown first


2. Geo-location in center pane: again a marble map globe or G maps, which shows geo-tagged images from the database in groups with image count
  • images shown on map will reflect what is filtered in the left pane


3. Geo-tagging window shows two maps which can move around separately, you just drag images to the map to geo-tag them.
  • select images from an album before opening the geo-tagging tool






Image conversion



Method 1. select an album -directory- and RC >Batch Process >Image Effects/ Recompress (no format conversion)/Resize


Method 2. select images (click on album header to select all) and add to a queue (Configure toolbar with the queue buttons or shorcut key, i.e. Q, for ease)
  • drag a Batch tool into the Assigned tools box, adjust the tool, choose whether to overwrite files or make a new album, and Run it 
  • other images can be added to another queue before a process has finished


Example: convert stills from HD video for showing/uploading (6Mb .png files in /Pictures/../NEW)
  • select PNG files and add to a queue and convert to jpeg's
  • then filter the album by mime type (PNG) and delete the PNG files (if necessary)
  • select all and batch rename, press F2, and thus "original" JPEG's are created
  • next, carry out any light enhancements, cropping, and/or just tagging and save changes to file
  • select all the images and add to a queue, select resize, 1200-1400 pix 85-90%, make a new album
  • once the images have been processed, the new album can be dragged over to the right directory in the collection
  • the album of "original" images can be backed up to removable media 


Digikam Wiki page kde.org/Digikam

Digikam Handbook http://docs.kde.org/development/...


Digikam automatically updates the "My Tags" list with any tags found in new images' IPTC data.


Whilst that is very handy, what if you save pics from the web which are full of useless tags?  It will be tiring to delete all the tags you don't need from those web pics and your Tags list (one by one!).  So I wouldn't save web pics into a Collection album.  Save them elsewhere, then you can remove all their tags before moving to an album.

Remove metadata with Imagemagick:
  • make a Thunar custom action or Ranger key with, for just the iptc data (keywords etc.): ls | xargs mogrify +profile iptc
  • for applying only to the selected files use mogrify +profile iptc %F
  • To remove ALL exif data (including datetimeoriginal etc) : ls | xargs mogrify -strip

    Warning! the ls function will apply the command to all files in the directory!
  • Use instead for selected files: mogrify -strip %F
  • there's also jhead, with the command to remove iptc (keywords) and xmp (subject) data: ls | xargs jhead -di -dx
  • or do jhead -di -dx %F


Patches




dump picasa and windows files from photo directories!!!


warning: all Picasa directory specific files will be permanently lost!
 



Image conversion with mogrify (Imagemagick)

Here are mainly Thunar right-click actions - all of these, if usable, are rewritten for Ranger (see my Ranger key mapping).

  • Edit >Configure custom actions >click + to make a new action, name it "convert all png to jpeg", with this next line as the command:
  • mogrify -format jpg -quality 100 *.png
  • in Appearance Conditions (for Thunar), enter *.png;*.PNG, and check "Image files"


Resize JPEGs for quick-viewing or uploading tasks
  • mogrify -resize '1200x1200>' -quality 90 *.jpg *.JPG
  • for a Thunar action, "resize all jpegs 1200p 90%", make conditions *.JPG;*.jpg;*.jpeg;*.JPEG

WARNING! this command will OVER-WRITE the image files so it's better done on copies of the originals put in a different directory too!

Or just copy the directories to another location to work in them.  1200x1200 ensures the max width OR height will be 1200pix. Just stating 1200 could leave you with some 1200 wide x1700 high images, for example.


If you need a custom action that can deal with only the selected files (and OVER-WRITES them), you can use something like:
  • mogrify -resize '800x800>' -quality 96 %F


Let's do one that produces files with a suffix to the filename (it doesn't over-write them):
  • mogrify -resize '800x800>' -quality 96 -format "jpg_1" %F


And how about with in infix, which will produce a new file "image_name.sm.jpg", like this
    • mogrify -resize '800x800>' -quality 96 -format "sm.jpg" %F


OK, here's something good. This is a mogrify command that will convert all images in a directory (you can make it selection-only too with %F {for Thunar, but %s for Ranger} on the end instead of file extensions) and put them into a new directory that hasn't yet been created (that I've named "reduced"). (check images and enter *.jpg;*JPG in appearance conditions)
  • mkdir reduced && mogrify -path reduced -resize '1200x1200>' -quality 90 *.jpg *.JPG


Or you can make a command so that all images in the directory which you click on will be size-reduced and put in a new directory alongside the one you clicked, with something like, (check "directories" in appearance conditions)
  • mkdir %f_a && mogrify -path %f_a -resize '1200x1200>' -quality 96 /%f/*{.jpg|.JPG}


Feel free to alter the new directory suffix (mine above is "_a" -it could be "_resized") and of course the mogrify arguments.

This one scans recursivley and resizes all the jpeg's in the sub-dir's of the dir your right click on, and puts them into new sub-directories -which means just two clicks (and potentially a long wait!) to produce small images from, say, a stack of original large images. (watch the cpu monitor to know when the mogrify process is finished)
  • for D in %f/* ; do mkdir "${D}"_a && mogrify -path "${D}"_a -resize '1200x1200>' -quality 95 "${D}"/*.{jpg,JPG}; done

or
  • find %f/ -mindepth 1 -type d | xargs -n1 -I {} bash -c 'mkdir "{}_a" && mogrify -path "{}_a" -resize '1200x1200\>' -quality 95 "{}/"*.{jpg,JPG}'


or, if you are in a dir of files, this one will reduce all the images and put them in a new dir alongside it:
    • mkdir "../%d_a"; mogrify -path "../%d_a" -resize '1200x1200>' -quality 90 *.jpg *.JPG


To do the above but to reduce the size of images in the directory, while overwriting the images, use this and click on the directory
  • mogrify -resize 1024x1024 -quality 84 %f/*.{jpg,JPG}


And to do that recursively, so as to resize all the images in however many sub-directories there may be (which is quite useful)
  • find %f/ -type f -name "*.jpg" -o -name "*.JPG" -print0 | xargs -0 mogrify -resize '1024x1024>' -quality 84 {} \;