It is currently Sat Aug 15, 2026 2:26 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: gmic color depth question
PostPosted: Thu Dec 25, 2014 8:16 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
If I understood correctly from the gmic documentation, gmic is able to support up to 16-bit color depth.
Does this pertain to the command line version or gmic plugins as well?

Can Gmic plugin for Krita and Partha's build of GIMP 2.9 (which includes gmic) handle 16-bit per channel*?
Are there also front-end limitations as well and some gmic filters weren't coded to handle >8-bit depth?
How much coding would it take to make 32-bit floating point** support possible?

Below are just my points of interest for higher color bit support but there are probably much more:
* for the raw images and gmic film emulation filters (similar to the Lightroom, Darktable development presets);
also to get rid of the gradient color banding issue.
** some file formats only make sense at 32-bit depth (e.g. OpenEXR, support's coming in GIMP 2.10)


Thanks, David!


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 color depth question
PostPosted: Thu Dec 25, 2014 6:58 pm  (#2) 
Offline
GimpChat Member

Joined: Feb 13, 2013
Posts: 86
G'MIC internal processing is 32-bit floating point.

The problem with using the GIMP plug in is GIMP only is 8-bit, so you are not using G'MIC to it's full potential. I'm not sure about 2.9.

When using the command line, you can scale the image to the 0-255 range before using a filter that expects images like that.

eg if you have a 16-bit image:

gmic.exe -i 16_bit_image.tif -div 257 -filter_you_want_to_use 1,2,3,4 -mul 255 -o 16_bit_image_processed.tif


Top
 Post subject: Re: gmic color depth question
PostPosted: Thu Dec 25, 2014 10:37 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
Thanks for the reply Iain.
Iain wrote:
G'MIC internal processing is 32-bit floating point.

A raster image is a pixel matrix, that follows its format rules, with up to 4 channels
setting the color according to the colorspace (RGB, CMYK, …) and with integers from
0 to 255 or to 65535, it depends on the number of bits.

Reading this in gmic wiki led me to a conclusion that 65535 integer puts color range to a 16-bit color depth.
It also mentions 4D floating-point number matrix but I had no clue how to translate it into a bit depth of pixel color component.
So, that really means a 32-bit floating point? Thanks for clarifying this.
Iain wrote:
The problem with using the GIMP plug in is GIMP only is 8-bit, so you are not using G'MIC to it's full potential. I'm not sure about 2.9.

Yes, I'm aware of that, this is why I only asked about gmic plugin for Krita and gimp 2.9.
Both do support 16- and 32-bit color depth.
Iain wrote:
When using the command line, you can scale the image to the 0-255 range before using a filter that expects images like that.
eg if you have a 16-bit image:
gmic.exe -i 16_bit_image.tif -div 257 -filter_you_want_to_use 1,2,3,4 -mul 255 -o 16_bit_image_processed.tif

Isn't scaling to 0-255 range the same as converting to 8-bit per channel image?
I realize that some gmic filters don't support higher color depth (nor they need to).
After all, half of the PS filters are grayed out when dealing with 16-bit images.
But conversion to 8-bit isn't an option for the cases I mentioned earlier (raw image processing
and gradient color banding)


Top
 Post subject: Re: gmic color depth question
PostPosted: Thu Dec 25, 2014 11:39 pm  (#4) 
Offline
GimpChat Member

Joined: Feb 13, 2013
Posts: 86
I can't tell you about the plugins, that will have to come from the plugin authors.

Scaling to the range 0-255 is not detrimental in G'MIC. 32-bit floating point processing can handle none integer numbers. eg if you divide 65543 (1 value below max in 16-bit) by 257 you get 254.9961089494163424124513618677 and G'MIC can handle the information after the decimal point.

You could test it by doing something like this in the command line

-div 1000000 -mul 1000000

and see if you can find any artifacts.


Top
 Post subject: Re: gmic color depth question
PostPosted: Fri Dec 26, 2014 9:48 am  (#5) 
Offline
GimpChat Member

Joined: Mar 14, 2011
Posts: 998
K1TesseraEna wrote:
If I understood correctly from the gmic documentation, gmic is able to support up to 16-bit color depth.
Does this pertain to the command line version or gmic plugins as well?

Yes, the commandline version of gmic can output 16-bit images.
Quote:
Can Gmic plugin for Krita and Partha's build of GIMP 2.9 (which includes gmic) handle 16-bit per channel*?
Are there also front-end limitations as well and some gmic filters weren't coded to handle >8-bit depth?
How much coding would it take to make 32-bit floating point** support possible?

It's not so much whether gmic can handle 16-bit images. It's whether it can output 16-bit images to Gimp. To do this, gmic will have to use GEGL buffers and provide the GIMP_PRECISION value for Gimp to set it as a 16-bit image.
Quote:
Below are just my points of interest for higher color bit support but there are probably much more:
* for the raw images and gmic film emulation filters (similar to the Lightroom, Darktable development presets);
also to get rid of the gradient color banding issue.
** some file formats only make sense at 32-bit depth (e.g. OpenEXR, support's coming in GIMP 2.10)


Thanks, David!

You can use UFRaw which will output 16-bit files after RAW processing. After that, you can use all the GEGL plugins that are provided to you. See if that helps. The ones that have been integrated are already in the filter menu. The others are under the Tools menu item.

If you really want gmic in 16-bit, you can try a work around. You can use Rob's Shellout python plugin (look at the bottom of the filters menu item in my builds) and perhaps you can set it up to run command line gmic.

Hope that helps.

Thanks,
Partha


Top
 Post subject: Re: gmic color depth question
PostPosted: Fri Dec 26, 2014 10:40 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
OK, to get 16-bit output from gmic the latter needs to be ported to gegl, this makes perfect sense.
Using the command line version via Shellout is a good idea. :bigthup
Thank you Partha!


Top
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


cron

* Login  



Powered by phpBB3 © phpBB Group