RSS/Atom feed Twitter
Site is read-only, email is disabled

open thumbnail and raw files

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

17 of 19 messages available
Toggle history

Please log in to manage your subscriptions.

OT: noise equivalence in HSV components Joseph Heled 22 Jul 00:21
OT: noise equivalence in HSV components William Skaggs 22 Jul 19:03
OT: noise equivalence in HSV components Joseph Heled 24 Jul 05:10
  open thumbnail and raw files Joseph Heled 28 Oct 08:43
   open thumbnail and raw files Sven Neumann 28 Oct 11:35
    open thumbnail and raw files Joseph Heled 03 Nov 12:19
   open thumbnail and raw files Sven Neumann 13 Nov 18:48
    open thumbnail and raw files Joseph Heled 21 Nov 19:52
     open thumbnail and raw files Adam D. Moss 21 Nov 20:47
     open thumbnail and raw files Sven Neumann 21 Nov 20:53
      open thumbnail and raw files Sven Neumann 21 Nov 21:50
       open thumbnail and raw files Joseph Heled 21 Nov 22:06
        open thumbnail and raw files Sven Neumann 21 Nov 23:53
OT: noise equivalence in HSV components William Skaggs 25 Jul 17:45
4188BCB8.5030603@quicksilve... 07 Oct 20:23
  open thumbnail and raw files Sven Neumann 03 Nov 12:35
87d5yu1sxu.fsf@gimp.org 07 Oct 20:23
  open thumbnail and raw files Joseph Heled 03 Nov 23:52
   open thumbnail and raw files Sven Neumann 04 Nov 10:21
Joseph Heled
2004-07-22 00:21:17 UTC (almost 20 years ago)

OT: noise equivalence in HSV components

This is not a gimp question, but perhaps there is someone here who can shed light on this issue,

How (or can you) combine errors/noise in HSV into one error/noise figure which reflects the total "human visual" error perception.

I am sure this is not a good formulation of the question. Here is another way to put it,
Take a picture I. Decompose to HSV. Now add noise Nh to H and recompose to get image I(h). Do the same for Ns to S and Nv to V. Now, what should the relation be between Nh,Ns,Nv so that a human would say "All three images I(h). I(s) and I(v) look like they had the same amount of corruption relative to the original I.

Now I am not necessarily asking for a rigorous answer. Any reasonable heuristic would do.

-Joseph

William Skaggs
2004-07-22 19:03:15 UTC (almost 20 years ago)

OT: noise equivalence in HSV components

Joseph Heled writes:

How (or can you) combine errors/noise in HSV into one error/noise figure which reflects the total "human visual" error perception.

HSV is the wrong colorspace to use for this purpose. The LA*B* colorspace was designed to do what you are trying to accomplish: supposedly, equal distances in LA*B* coordinate space correspond to equal distances in human perceptual space -- although I understand that there is debate about whether this is really true.

(Of course, you have to be careful about what you are trying to do. If you shift an entire image one pixel to the right, it will probably look identical to a human although it may be quite different on a pixel-for-pixel basis. In general, integrating pixel-by-pixel color differences will not give you a very accurate picture of how much difference people perceive between two images.)

The "decompose" plug-in in Gimp will decompose an image into LAB coordinates -- however, I looked at the source code recently in connection with a bug report (bug #147603), and it seems that the LA*B* algorithm is not correctly implemented by the plug-in, so you should be cautious in using it for anything important.

Best, -- Bill


______________ ______________ ______________ ______________ Sent via the KillerWebMail system at primate.ucdavis.edu

Joseph Heled
2004-07-24 05:10:11 UTC (almost 20 years ago)

OT: noise equivalence in HSV components

> HSV is the wrong colorspace to use for this purpose. The LA*B* > colorspace was designed to do what you are trying to accomplish: > supposedly, equal distances in LA*B* coordinate space correspond to > equal distances in human perceptual space -- although I understand > that there is debate about whether this is really true.

I might be wrong, but this will not solve it either. I assume the AB (color information) might be in the "same" units, but I don't think Luminosity is. (and I can make the argument that Hue and Saturation are in the "same" units as well, the problem being how to fit Value in)

-Joseph

William Skaggs
2004-07-25 17:45:17 UTC (over 19 years ago)

OT: noise equivalence in HSV components

Joseph Heled writes:

I might be wrong, but this will not solve it either. I assume the AB (color information) might be in the "same" units, but I don't think Luminosity is. (and I can make the argument that Hue and Saturation are in the "same" units as well, the problem being how to fit Value in)

Well, I don't claim to be an expert on any of this stuff, but please take a look at

http://www.dcs.ed.ac.uk/home/mxr/gfx/faqs/colorconv.faq

Best, -- Bill


______________ ______________ ______________ ______________ Sent via the KillerWebMail system at primate.ucdavis.edu

Joseph Heled
2004-10-28 08:43:44 UTC (over 19 years ago)

open thumbnail and raw files

The gimp Open Image dialog contains preview thumbnail. To generate them, gimp calls the plugin to generate them. Now, for raw digital camera files (.nef, .crw ...) this is a very expensive operation - and obviously one would love to use the prepared/pre-stored thumbnail which exists in the file.

From what I could see, there is no way I (the plugin author) can detect if the call is for a thumbnail or not.

Can someone tell me if I am right or wrong?

If wrong - how do I do it? If right, is there a chance this can be changed?

Thanks, Joseph

Sven Neumann
2004-10-28 11:35:37 UTC (over 19 years ago)

open thumbnail and raw files

Hi,

Joseph Heled writes:

The gimp Open Image dialog contains preview thumbnail. To generate them, gimp calls the plugin to generate them. Now, for raw digital camera files (.nef, .crw ...) this is a very expensive operation - and obviously one would love to use the prepared/pre-stored thumbnail which exists in the file.

From what I could see, there is no way I (the plugin author) can detect if the call is for a thumbnail or not.

Can someone tell me if I am right or wrong?

If wrong - how do I do it? If right, is there a chance this can be changed?

You are right. You could suggest an API and we could consider to add it for GIMP 2.4.

Sven

Joseph Heled
2004-11-03 12:19:26 UTC (over 19 years ago)

open thumbnail and raw files

Sven Neumann wrote:

Hi,

Joseph Heled writes:

The gimp Open Image dialog contains preview thumbnail. To generate them, gimp calls the plugin to generate them. Now, for raw digital camera files (.nef, .crw ...) this is a very expensive operation - and obviously one would love to use the prepared/pre-stored thumbnail which exists in the file.

From what I could see, there is no way I (the plugin author) can detect if the call is for a thumbnail or not.

Can someone tell me if I am right or wrong?

If wrong - how do I do it? If right, is there a chance this can be changed?

You are right. You could suggest an API and we could consider to add it for GIMP 2.4.

The most natural place is to add an optional argument to the run() gimp arguments. However I am not sure if this is possible. The plugin is a "file loader", registered under "Load"

gimp_install_procedure ("file_rawphoto_load", "...",
PLUG_IN_VERSION,
"/rawphoto",

I guess "Load" implies some magic, since it is not visible in the regular menus. And perhaps 3 arguments is hardwired for such plugins? Can someone enlighten me?

(P.S it would certainly make sense to run this plugin non interactively from a script, and in that case supply even additional arguments ...)

-Joseph

Sven

Sven Neumann
2004-11-03 12:35:50 UTC (over 19 years ago)

open thumbnail and raw files

Hi,

Joseph Heled writes:

The most natural place is to add an optional argument to the run() gimp arguments. However I am not sure if this is possible.

The plug-in interface must remain API and ABI compatible to GIMP 2.0 so changing any of the existing functions is not an option.

The plugin is a "file loader", registered under "Load"

gimp_install_procedure ("file_rawphoto_load", "...",
PLUG_IN_VERSION,
"/rawphoto",

I guess "Load" implies some magic, since it is not visible in the regular menus. And perhaps 3 arguments is hardwired for such plugins? Can someone enlighten me?

The menu is a concept that isn't used in 2.2 any longer. Please have a look at how file plug-ins register in GIMP 2.2. The new API is backward compatible with the old one of course. But it doesn't really make sense to look at the old APIs if we want to discuss further enhancements.

(P.S it would certainly make sense to run this plugin non interactively from a script, and in that case supply even additional arguments ...)

There's nothing that keeps you from doing that. If you are looking for an example, check out the SVG loader plug-in.

Sven

Joseph Heled
2004-11-03 23:52:26 UTC (over 19 years ago)

open thumbnail and raw files

Sven Neumann wrote:

Hi,

Joseph Heled writes:

Great. So what I suggest - i.e. a forth argument to run() to indicate a request for a thumbnail should work and not break other plugins?

I think you need to make yourself familiar with the GIMP API. Did you
ever look at the API reference manual?

Not in full, but I can't see why it will help, since this is internal to gimp itself.

No it isn't. If I understand your approach, you suggested to add parameters to run()

Not at all. I meant to add a parameter to 'param'

run(const gchar* name, gint nparams,
const GimpParam* param,
...)

This affect only load plugins with 4 declared arguments (by the plugin), the forth named "thumbnail".

static GimpParamDef load_args[] = {
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "URI of the file to load" }, { GIMP_PDB_INT32, "thumbnail", "use embedded thumbnail" },

(I would need to be superman to make a working change to run() in 15 minutes ... :)

-Joseph

even though run() of course has a fixed set of parameters. Since it is probably the most important function in the GIMP API and implemented by all plug-ins, there is certainly not an option to change it. What we need here is a way for load plug-ins to register and additional procedure to load the thumbnail. This could probably be designed in a way that would allow plug-ins to reuse their main procedure.

I am however not going to continue this discussion in private mail. If you want to talk about it, please use the mailing-list.

No problem. I thought it is best not to inflict my ignorance on the whole list.

Sven

Sven Neumann
2004-11-04 10:21:14 UTC (over 19 years ago)

open thumbnail and raw files

Hi,

Joseph Heled writes:

This affect only load plugins with 4 declared arguments (by the plugin), the forth named "thumbnail".

static GimpParamDef load_args[] = {
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" }, { GIMP_PDB_STRING, "filename", "The name of the file to load" }, { GIMP_PDB_STRING, "raw_filename", "URI of the file to load" }, { GIMP_PDB_INT32, "thumbnail", "use embedded thumbnail" },

That would break all load plug-ins that already have >= 4 parameters which is certainly not an option. Also, your proposal doesn't pass a preferred thumbnail size to the load plug-in. There are file formats that include thumbnails for several sizes or can generate thumbnails of any size on the fly.

Let me explain it again: What we need here is a way for load plug-ins to register an additional procedure that the core can use to load the thumbnail. The core can then check if such a procedure exists and fall back to the default load procedure otherwise.

Sven

Sven Neumann
2004-11-13 18:48:35 UTC (over 19 years ago)

open thumbnail and raw files

Hi,

a while ago Joseph Heled wrote:

The gimp Open Image dialog contains preview thumbnail. To generate them, gimp calls the plugin to generate them. Now, for raw digital camera files (.nef, .crw ...) this is a very expensive operation - and obviously one would love to use the prepared/pre-stored thumbnail which exists in the file.

From what I could see, there is no way I (the plugin author) can detect if the call is for a thumbnail or not.

Note that I have just added the missing API for plug-ins and also implemented the core functionality. What's missing now is some more plug-ins using this feature. See also

http://bugzilla.gnome.org/show_bug.cgi?id=158190 http://bugzilla.gnome.org/show_bug.cgi?id=158191 http://bugzilla.gnome.org/show_bug.cgi?id=158192 http://bugzilla.gnome.org/show_bug.cgi?id=158193

Sven

Joseph Heled
2004-11-21 19:52:28 UTC (over 19 years ago)

open thumbnail and raw files

Hi,
In most raw files the thumbnail exists as an embedded jpeg. I know how to read it to memory, but need advice on how to load it into gimp (i.e. create a valid image ID for it).

Option a) Perhaps such functionality already exists - but I did not find it?

Option b) Go through the file system - write a temporary file and load it via a PDB call.

Option c) Use some jpeg library (say libjpeg) to read it.

(b) is the probably the simplest, but I am not happy about going to the file system and all the issues it brings. On the other hand (c) is quite complicated.

Can someone make a suggestion?

Thanks, Joseph

Sven Neumann wrote:

Hi,

a while ago Joseph Heled wrote:

The gimp Open Image dialog contains preview thumbnail. To generate them, gimp calls the plugin to generate them. Now, for raw digital camera files (.nef, .crw ...) this is a very expensive operation - and obviously one would love to use the prepared/pre-stored thumbnail which exists in the file.

From what I could see, there is no way I (the plugin author) can detect if the call is for a thumbnail or not.

Note that I have just added the missing API for plug-ins and also implemented the core functionality. What's missing now is some more plug-ins using this feature. See also

http://bugzilla.gnome.org/show_bug.cgi?id=158190 http://bugzilla.gnome.org/show_bug.cgi?id=158191 http://bugzilla.gnome.org/show_bug.cgi?id=158192 http://bugzilla.gnome.org/show_bug.cgi?id=158193

Sven

Adam D. Moss
2004-11-21 20:47:49 UTC (over 19 years ago)

open thumbnail and raw files

Joseph Heled wrote:

Option b) Go through the file system - write a temporary file and load it via a PDB call.
(b) is the probably the simplest, but I am not happy about going to the file system and all the issues it brings.

I wouldn't be too shy about it. The jpeg plugin itself (last I saw) does a similar thing when in 'preview' mode. Whatever works!

--Adam

Sven Neumann
2004-11-21 20:53:40 UTC (over 19 years ago)

open thumbnail and raw files

Hi,

Joseph Heled writes:

In most raw files the thumbnail exists as an embedded jpeg. I know how to read it to memory, but need advice on how to load it into gimp (i.e. create a valid image ID for it).

Option a) Perhaps such functionality already exists - but I did not find it?

Option b) Go through the file system - write a temporary file and load it via a PDB call.

Option c) Use some jpeg library (say libjpeg) to read it.

(b) is the probably the simplest, but I am not happy about going to the file system and all the issues it brings. On the other hand (c) is quite complicated.

(b) wouldn't work at all since you need to register a thumbnail procedure from within your raw loader and you can't use the existing JPEG load procedure since it doesn't have the right signature.

Can someone make a suggestion?

I suggest you use libjpeg. I also strongly suggest that you look at one of the plug-in in 2.2-pre2 that implement this functionality.

Sven

Sven Neumann
2004-11-21 21:50:24 UTC (over 19 years ago)

open thumbnail and raw files

Hi,

Sven Neumann writes:

(b) wouldn't work at all since you need to register a thumbnail procedure from within your raw loader and you can't use the existing JPEG load procedure since it doesn't have the right signature.

Thinking about it more, it would actually be possible. You'd have to call the file_jpeg_load procedure on a temporary file from within your file_dcraw_load_thumb procedure and pass the returned image_id back to gimp. That would work but I still think using libjpeg makes more sense here.

Sven

Joseph Heled
2004-11-21 22:06:00 UTC (over 19 years ago)

open thumbnail and raw files

After some more digging, I think I will use gdk_pixbuf_loader, like

GdkPixbufLoader* l = gdk_pixbuf_loader_new(); GError* err = 0;
gboolean ok = gdk_pixbuf_loader_write(l, my_buffer, my_buffer_len, &err); if( ! ok ) {
return;
}

GdkPixbuf* b = gdk_pixbuf_loader_get_pixbuf(l); // Build image from pixbuf ...

Any comments?

-Joseph

Sven Neumann wrote:

Hi,

Sven Neumann writes:

(b) wouldn't work at all since you need to register a thumbnail procedure from within your raw loader and you can't use the existing JPEG load procedure since it doesn't have the right signature.

Thinking about it more, it would actually be possible. You'd have to call the file_jpeg_load procedure on a temporary file from within your file_dcraw_load_thumb procedure and pass the returned image_id back to gimp. That would work but I still think using libjpeg makes more sense here.

Sven

Sven Neumann
2004-11-21 23:53:30 UTC (over 19 years ago)

open thumbnail and raw files

Hi,

Joseph Heled writes:

After some more digging, I think I will use gdk_pixbuf_loader

Yes, why not. Seems reasonable since you can probably assume that the embedded thumbnail won't be too large.

Sven