Add icc profile to a batch of phots

Bug #547011 reported by Antonio Roberts
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Phatch
Invalid
Undecided
Stani

Bug Description

I need to convert several images from one colour space to another. I know that Phatch has support for several built-in colour spaces, but I'd like to be able to select an icc profile file and then apply it to a group of images

Revision history for this message
robinmills (robinmills) wrote :
Download full text (6.0 KiB)

Guys

I've had an off-line discussion with Antonio about this. He hasn't updated me to say how this worked out for him. However I think this is useful background into the possibility of providing an ICC profile action in Phatch. The littlecms library is built and included in the Mac bundle for the jpegtrans utility.

Hi Antonio

I've tried the Synaptic Package Manager on Unbuntu 9.10 and typed jpegicc into the QuickSearch field. It offered "liblcms-utils", so I selected that and it installed jpegicc (painless).

I found some profiles such as "Black & White.icc" on my Mac (in /Library/ColorSync/Profiles/) and used them on a photo:

jpegicc -o "Black & White.icc" R.jpg mono.jpg

The original 2mb file was untouched and I got a 800k file with a black and white (not gray scale). I tried some others (Gray Tone, Sepia Tone and Blue Tone) and all seemed to work fine. I was rather disappointed that jpegicc removed all exif data from the output jpgs - so I'm a little uncertain about exactly what's been done. Presumably, he processed the image and wrote a minimal jpg in the output. I noticed that mono.jpg was still in the RGB color space - so although he'd converted the pixels, I wasn't convinced that he had really changed the color space in the JPG itself. Anyway - for sure it processed the image.

If you want to run this in a loop over a directory of files, you can use bash or Perl or Python or anything you like really. For example, in bash something like:

#!/bin/bash
mkdir output
for file in `ls *.jpg`; do jpegicc -o "Gray Tone.icc" $file output/$file ; done

will probably win the day (provided you don't have spaces in the file names).

I hope that helps.

Robin
http://clanmills.com

518 /Library/ColorSync/Profiles $ ls -alt
total 968
drwxrwxr-x 3 root admin 102 Jan 1 13:52 Displays
drwxrwxr-x 15 root admin 510 Dec 21 21:39 .
drwxrwxr-x 4 root admin 136 Dec 21 21:27 ..
-rw-r--r--@ 1 root admin 0 Sep 12 2009 Profiles
-rw-r--r--@ 1 root admin 0 Sep 12 2009 Recommended
-rw-rw-r-- 1 root admin 25624 Jul 29 2009 Black & White.icc <--- tried this one
-rw-rw-r-- 1 root admin 30420 Jul 29 2009 Blue Tone.icc <---- tried this one
-rw-rw-r-- 1 root admin 30420 Jul 29 2009 Gray Tone.icc <--- tried this one
-rw-rw-r-- 1 root admin 2736 Jul 29 2009 Lightness Decrease.icc
-rw-rw-r-- 1 root admin 2728 Jul 29 2009 Lightness Increase.icc
-rw-rw-r-- 1 root admin 30428 Jul 29 2009 Sepia Tone.icc <--- tried this one
-rw-rw-r-- 1 root admin 10780 Jul 29 2009 WebSafeColors.icc
-rwxrwxrwx@ 1 rmills staff 8708 Feb 2 2006 EW-sRGB
-rwxrwxrwx@ 1 rmills staff 200460 Jul 23 2004 EPSON Perfection4990 TPU
-rwxrwxrwx@ 1 rmills staff 200436 Jul 22 2004 EPSON Perfection4990
519 /Library/ColorSync/Profiles $

On Mar 31, 2010, at 2:12 AM, Antonio Roberts wrote:

Hi Robin,

Thanks very much for your suggestsions, I would be very greatful for a
walkthrough on how to get little cms to do this until Phatch has this
ability. I'm currently running Ubuntu 9.10 (though will be on 10.04
very soon)

Thanks again,

Antonio

On 25 March 2010 16:44, Robin Mills...

Read more...

Revision history for this message
Stani (stani) wrote :

Hi Antonio,
Thanks for your interest in Phatch! It is on our radar, but we have not pinned it to a release yet. There is a blueprint for this already:
https://blueprints.launchpad.net/phatch/+spec/littlecms-action

PIL 1.1.7 now has support for cms, but Igors implementation (python API, no subprocesses) is probably superior. I haven't dived into the subject yet. Igor is a very nice person and cooperative. He himself offered his module to Phatch. So Robin, if you want to work on this (after we get 0.2.8 ready for Mac), I can get you in touch with Igor.

Changed in phatch:
assignee: nobody → Stani (stani)
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.