It is currently Thu Aug 20, 2026 6:27 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: GMIC richardson-lucy problem: turns image blue???
PostPosted: Wed Feb 04, 2015 12:28 pm  (#1) 
Offline
GimpChat Member

Joined: Feb 04, 2015
Posts: 14
(this is a cross post from another site where someone suggested I might be more likely to get a response here…)
I've used this filter {GMIC/Details/Sharpen[richardson-lucy]} successfully on a number of images…

However, I've hit one specific jpg where applying the filter turns the upper half only of the image to what looks like the blue channel (turning off the blue channel and doing new from visible to create a yellow version, then using this filter results in a black image). It is somewhat difficult to tell, but comparing the blue channel of the original to the filter output, it does not appear the filter sharpened the image.

The problem is with the one image: other images work normally when tested.

Exporting the image as a jpg and using Sharpen[richardson-lucy] on that image shows the same results.
Duplicating the layer, setting the upper layer to Overlay, Merge Down, and applying Sharpen[richardson-lucy] gives a totally black image.

Exiting and restarting GIMP did not fix the problem: the one image still turns to upper half blue & lower half unchanged.
In all casses the previews within GMIC normal.

The filter also takes much long to run than on images (including compared to substantially larger images) where it works normally…

I'm curious both as to what could cause this behavior, and if anyone else has experienced something similar.....

Further info
Since posting the original question 31Jan15, I've found that applying the filter only to the excised critical area (a face) produces normal results. Much of the BG in the full image is a dark blue, which I'm guessing has something to do with the original problem.

I'd still appreciate knowing what conditions cause this to happen, since I'm not able to get similar results from other pics with dark BGs


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Wed Feb 04, 2015 1:58 pm  (#2) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 14158
Location: Native to NYC living in Arizona, Gimp 2.8 - 3.0, Win 11 PC.
WhiteRhino wrote:
(this is a cross post from another site where someone suggested I might be more likely to get a response here…)
I've used this filter {GMIC/Details/Sharpen[richardson-lucy]} successfully on a number of images…

However, I've hit one specific jpg where applying the filter turns the upper half only of the image to what looks like the blue channel (turning off the blue channel and doing new from visible to create a yellow version, then using this filter results in a black image). It is somewhat difficult to tell, but comparing the blue channel of the original to the filter output, it does not appear the filter sharpened the image.

The problem is with the one image: other images work normally when tested.

Exporting the image as a jpg and using Sharpen[richardson-lucy] on that image shows the same results.
Duplicating the layer, setting the upper layer to Overlay, Merge Down, and applying Sharpen[richardson-lucy] gives a totally black image.

Exiting and restarting GIMP did not fix the problem: the one image still turns to upper half blue & lower half unchanged.
In all casses the previews within GMIC normal.

The filter also takes much long to run than on images (including compared to substantially larger images) where it works normally…

I'm curious both as to what could cause this behavior, and if anyone else has experienced something similar.....

Further info
Since posting the original question 31Jan15, I've found that applying the filter only to the excised critical area (a face) produces normal results. Much of the BG in the full image is a dark blue, which I'm guessing has something to do with the original problem.

I'd still appreciate knowing what conditions cause this to happen, since I'm not able to get similar results from other pics with dark BGs

It could be that this particular jpg file is corrupt in some way.
Have you tried to convert the image to say a png file or a gif file and then trying to use that G'Mic filter on it?

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Wed Feb 04, 2015 7:19 pm  (#3) 
Offline
GimpChat Member

Joined: Feb 13, 2013
Posts: 86
Sounds like a problem with the parallel processing. Does it still happen if you set parallel processing to one thread?


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Thu Feb 05, 2015 3:07 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Is this possible to get a test case (image + parameters used) to be able to reproduce the problem ?
Thanks !


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Fri Feb 06, 2015 7:55 pm  (#5) 
Offline
GimpChat Member

Joined: Feb 04, 2015
Posts: 14
THX for the responses :bigthup
I hadn't mentioned, but I'm using "-2014/08/20 : version 1.6.0.0 (current stable)" per the release notes under GMIC about

Played some more with this today and find myself in engineering hell (I am now unable to replicate the top half to blue channel behavior) {Changing the preview type to "Duplicate Horizontal" (which I remember using in several of the early attempts) does not have any effect}

Wallace wrote:
It could be that this particular jpg file is corrupt in some way.
Have you tried to convert the image to say a png file or a gif file and then trying to use that G'Mic filter on it?

I'd previously tried both
— exporting the file from GIMP as a jpg (just open the file then export it under a different name)
— exporting the file after duplicating the layer and setting the duplicate to Overlay100%

I've tried your suggestion and converted the original to a png (both with GIMP and with IrfanViewer); both png files turn completely black (#000000) after applying the filter.

Iain wrote:
Sounds like a problem with the parallel processing. Does it still happen if you set parallel processing to one thread?
Interesting idea, but unfortunately get full black regardless of the parallel processing setting. (Used auto & one thread on each test image: the original, & each png created per Wallace's suggestion. )

Ronounours wrote:
Is this possible to get a test case (image + parameters used) to be able to reproduce the problem ?
Thanks !

Base image cannot be provided "Your post looks too spamy for a new user, please remove off-site URLs." All one (1) of them :gaah though if you were to check imagebam image b3361b387760459 you could find it

Unfortunately this is a reupload/rehosting of my copy -- I can't find anything to tell me where i dowloaded the image from…
Parameters are default for the filter (other than trials with Iain's suggested one thread change).
[Sigma 1.00
Iterations 10
"Cut" checked
Parallel processing Auto (or One thread - see above)
Spatial overlap 24
Preview type Full]

I'd done some more or less random changing when I first hit this problem, but neglected to take notes :pound

I had made some trials using either the top half or either of the top quarters (1/2 vert x 1/2 hrz) copied and pasted as a new image with the thinking the issue might be memory, but these all went to black as well :scratch:


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Fri Feb 06, 2015 8:08 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
You can use the attachment below to upload your image
Image
OR, after you have made 5 posts you can use this upload file button Image

_________________
Image


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Fri Feb 06, 2015 9:12 pm  (#7) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
Looks like a genuine problem - I've downloaded WhiteRhino's image from imagebam, run the Richardson-Lucy filter on it and all I got out was solid black. All the other Gimp and GMIC filters I've tried seem to handle it okay.

So I tried pre-scaling the image (in Gimp) before running the Richardson-Lucy on it and this is what happened:
-at 50% scale - okay
-at 60% or 70% - just blue channel, like this:
Image
- at 80% or above - solid black.


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Fri Feb 06, 2015 10:22 pm  (#8) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
Further to the above, the Richardson-Lucy filter seems to have a problem with the unusually high proportion of very dark pixels in this image - there are a lot at, or very close to, absolute black (rgb=0,0,0).
If you use Gimp <Image>Colors>Curves and set the left point to x=0,y=3 (thus raising the dark level just over 1%) the filter will then work okay!


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Sat Feb 07, 2015 2:03 am  (#9) 
Offline
GimpChat Member

Joined: Feb 13, 2013
Posts: 86
I've had a look at the G'MIC filter code and I suspect there is a problem with dividing by zero.

For a work around go to Various-> Custom code(local) and replace the text in the box with

-add .1
-deblur_richardsonlucy 1,10,1
-sub .1

where the numbers follow -deblur_richardsonlucy are the parameters Sigma,Iterations, Blur type (0=expotential, 1 =Gaussian)


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Sat Feb 07, 2015 4:09 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Hello,

I've not been able to download the image from imagebam, so I only relies on what Iain says.
Then, I've slightly modified the code of the Richardson-Lucy algorithm to avoid divisions by zero.
If you have latest version 1.6.0.4 then you could try to press the update button, and see if the problem still arises.
In case you have an older version, then please upgrade to 1.6.0.4 :)

Thanks for reporting.


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Sat Feb 07, 2015 5:28 am  (#11) 
Offline
GimpChat Member

Joined: Feb 13, 2013
Posts: 86
I have tested and it works for me on the provided test image.


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Sat Feb 07, 2015 9:41 am  (#12) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
Yes, new preset works okay.


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Sat Feb 07, 2015 11:27 am  (#13) 
Offline
GimpChat Member

Joined: Feb 04, 2015
Posts: 14
Upgraded GIMP to 2.8.14
Upgraded GMIC to 1.6.0.4

Now works :jumpclap :jumpclap :jumpclap
:tyspin
I'd managed to work around the problem, but it is WONDERFUL to be able to get not just confirmation the the problem wasn't on my end, but a fix :wow


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Sat Feb 07, 2015 11:53 am  (#14) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
@WhiteRhino
I suspect that the image in question had previously been processed with PS or some other image manipulator to increase the contrast - the sheer proportion of absolute black in the image is not "natural" under any lighting conditions ..the man's suit was probably originally a dark grey and the shadows in the curtains at the back should be darker hues of the bright blue in the fore of the folds (not absolute black!). The whole image has been manipulated to force the darkest hues down to absolute black. That's why this image did have a problem with the RIchardson-Lucy filter but your others didn't. Anyway, looks like the problem is sorted now.


Top
 Post subject: Re: GMIC richardson-lucy problem: turns image blue???
PostPosted: Sat Feb 07, 2015 2:04 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Good news indeed ! Thanks again for reporting :)


Top
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group