applescript and colorsync
applescript and colorsync
- Subject: applescript and colorsync
- From: Paul Wagland <email@hidden>
- Date: Tue, 6 Jan 2004 09:08:42 +0100
Hi all,
Hopefully there is someone out here who can help me...
I have a Minolta DiMAGE 7 camera, which is quite a good camera except
for one annoying little problem, it does not save it's photos in the
standard RGB colorspace. I have managed to install the ICC profile into
all of the images (long live graphicconverter!) And was looking at how
to then convert these to "standard" colour profile JPEGs for viewing on
non Mac platforms. If you don't do this, then most (all?) of the
windows/unix users will see washed out images. So, my plan was to have
a simple droplet that just copies the file from aaaa.jpg to
aaaa.RGB.jpg and then convert the colorspace of aaaa.RGB.jpg so that it
can be viewed correctly without an associated colour profile.
I am a bit new to the whole applescripting thing and have been having a
few problems. My first issue was with trying to use the results of 'set
file2 to (tell app "Finder" duplicate file1)' instead of 'set file2 to
(tell app "Finder" duplicate file1) as alias' thing. That had me going
for a little while, especially since the documentation all states that
duplicate returns a reference. Anyway, got that one solved.
The second problem is how to convert the colorspace. Using the sample
colorsync applications that came with 10.3 I was thinking that this
would be simple. Just convert the colorspace to "sRGB Profile" and
Bob's yer uncle. Except that it doesn't work, or more precisely, I
don't understand how it is meant to work. The closest I can get to what
I want is shown below.
The question however is: How do I convert from a given profile "a" to a
given profile "b" and have it show up correctly on the screen. I would
expect that I should be able to get very close to identical screen
output from the modified profileless sRGB JPEG and the original
embedded profile Minolta JPEG.
Using the following
set MinProf to profile "Minolta DiMAGE 7"
set rgbProf to profile "sRGB Profile"
I have tried the following, all to no success:
tell app "ColorSyncScripting"
proof image onto proof rgbProf
match image to destination rgbProf
proof image to destination rgbProf
proof image to destination rgbProf onto proof rgbProf
proof image from source MinProf to destination rgbProf onto proof
rgbProf
end tell
These have varying degrees of sucess, though none of them come out
looking the same as if I just view the original image. And when I say
not the same, I don't mean you need a microscope to spot the
differences, in some cases the colours are just completely wrong.
The full source (sans the copyright comments and
filelistFromSelection() which I swiped from the Apple colorsync sample
scripts) is shown below:
-------------
on open draggeditems
tell application "ColorSyncScripting" to launch
set sourcefiles to filelistFromSelection(draggeditems)
repeat with thisFile in sourcefiles
tell application "Finder"
set new_name to the name of thisFile
set new_name to new_name & ".RGB"
set rgbFile to (duplicate thisFile) as alias
set name of rgbFile to new_name
reveal item rgbFile
end tell
try
tell application "ColorSyncScripting"
set sourceProf to profile "Generic RGB Profile"
set destProf to profile "Minolta DiMAGE 7"
set proofProf to profile "Generic RGB Profile"
proof rgbFile from source destProf to destination proofProf onto
proof destProf unembed rgbFile
end tell
on error errmsg
activate
display dialog errmsg
end try
end repeat
tell application "ColorSyncScripting" to set quit delay to 5
end open
------------
Please, can anybody help me?
Cheers,
Paul
[demime 0.98b removed an attachment of type application/pgp-signature which had a name of PGP.sig]
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.