G'MIC's preview is different from what is rendered

(Jai Guru) #1

Hello everyone. I installed G’MIC and I was trying to apply the effects. Specifically I was using the Paint Daub effect. The preview looked great, but when I pressed okay I got something entirely different. This is true no matter what effect I try to apply.

For a look at what I’m seeing here are before and after screen shots. Note I changed nothing before pressing ok.

The Preview:


After Rendering:


(Mica) #2

Many of the gmic filters depend on the size of the input image, even in the preview window, so zooming in or out changes the effect. Most of the time you can play with the sliders until you get what you want.

(David Tschumperlé) #3

To be more precise about this topic :
When a developer designs a filter, he should also try to develop a corresponding ‘filter preview’ so that the rendering of the preview and the filter match. Sometimes it’s really easy (the same code for the final rendering and the preview make the match), sometimes it’s harder (can be nearly impossible when the filter uses both local and global image information).
In your case, it seems Samj used a somehow wrong default zoom factor for the preview (global view), instead of a local view. I’ll try to fix that by setting a better default preview zoom factor (1:1 here probably).
I don’t claim this will entirely fix the issue, only Samj could tell in this case :slight_smile:

(Pat David) #4

So, can’t help but notice that you’re ok with blocking me on reddit when I answer your question there…


Just so you know, there’s likely to be more “…apologists for poor programming…” around here as well… :slight_smile: Also, my answer is no different. Some of the filters are complex and can only be accurate when viewed at 100% scale, which is pretty much the same as just applying the filter…


I suppose what @Jai_Guru wants is a preview mode that uses the full image area, even if it’s slow and computationally expensive, in case of scale-variant things like this.

So that the filter effects can actually be previewed without having to go in and out of the dialog box.

(this is part of why I’ve made Filmulator always run on the full resolution, even though it’s perfectly scale-invariant)

(Pat David) #6

Yep, and in some cases this might be no different than actually running the filter on the entire image. Which was what I was trying to point out previously. On a side note - there are no ops in Filmulator that are scale-dependent?


The difference is that if it’s in the preview window, you can tweak the slider more easily.

(and currently, there are no scale-variant ops in Filmulator. I just like having the full view available from the start instead of having to wait to zoom or pan.)

(Pat David) #8

Not really a difference when it’s technically no easier than simply re-invoking the dialog. The benefit of running it on the full image and saving the output as a new layer is that you don’t have to incur the re-computation time to go back to a previous result.

Of course, if you think users are upset that the preview doesn’t match the output, wait until they have to wait 5 or 10 minutes just to get a preview to show up in the first place.

(Mica) #9

Is gmic CPU bound or can it run on the GPU as well?

(David Tschumperlé) #10

G’MIC uses OpenMP for parallelization, running so on multiple CPU cores.
It doesn’t use GPU at all.

(Mica) #11

Thanks @David_Tschumperle!


I was playing around with the GUI Retinex and Tone mapping filters and noticed that the preview and resultant layer don’t match in appearance. Searching the forum lead me to this year-old thread. It would be nice if things were WYSIWYG but I generally use CLI so it doesn’t matter as much to me. I would be happy to provide more info like screenshots if anyone is interested.


(David Tschumperlé) #13

Did you change the preview zoom factor ? If so, it is likely the preview won’t match.
But even if not, it’s really hard for a filter to get an accurate preview without computing it on the full image (which is not something we do, as it would generally take too much time).


Just checking in to see if that was the expected behavior… No, I didn’t change the zoom factor or touch the other controls.

I understand the problem but for the average user the obvious question would be: why bother with a preview if it isn’t predictable or accurate? For filters like Retinex or Tone mapping, which tend to be abstract and setting sensitive, if the preview and output don’t match, it is very difficult for the user to determine which settings are appropriate for their use case.


I been having this issue on Krita and GIMP. If I use 16 bit float, GMIC preview the image darker.