Re: Color management and Simple Scan



Thanks very much Richard!

Very interested in the GDK patch - I need to make a patch there too to embed resolution information:
https://bugs.edge.launchpad.net/simple-scan/+bug/484616

I think I need to do the conversion regardless so the preview is displayed correctly.  Thanks for the lcms link.

--Robert

2009/12/21 Richard Hughes <hughsient gmail com>
2009/12/20 Robert Ancell <robert ancell gmail com>:
> I don't know much about color management so my question is:
> - What do I need to do to make Simple Scan work with GNOME Color Manager?
> - Is there a GPL project I can lift some code from?

Well, first you need to ask gnome-color-manager for a list of suitable
profiles using the DBus interface:
http://git.gnome.org/browse/gnome-color-manager/plain/src/org.gnome.ColorManager.xml

If you know the device you're using (you probably should) then you can
call GetProfilesForDevice() with the sysfs path, and a list of
profiles will be returned. If more than one profile is returned you
probably need to show it in a combo-box or something, but it would be
quite unusual for more than one profile to be returned. If you get no
results, then it's probably because the user has never assigned a
profile for that device (i.e. there is no a-priori mapping). In this
case you can either default to not doing color conversion yourself, or
instead call the GetProfilesForType() dbus method, using the
type=scanner. This will return a list of profiles that are suitable
for use with scanners.

Now, when you have a filename of the profile you want to use it's an
easy (!) case of acquiring the image like usual, and then you can
either:

* Just save the image with an embedded color profile (see bug
https://bugzilla.gnome.org/show_bug.cgi?id=604610 -- I'm working as
fast as I can on the infrastructure bits)
* Convert the image from device-mapping to something like sRGB using
lcms (there are examples in the lcms tarball)

I think it's probably best you do the first one, unless you know
you're going to be using the images in a non-color-aware application.

Anyway, I hope that helps,

Richard.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]