Page 1 of 1

PNG "Threshold filter can be applied to grayscale images..

PostPosted: Thu Jul 14, 2011 12:35 am
by chrisjj
1 Launch Image Processing Lab v.2.7.0
2 Load a grayscale PNG
3 select Filters, Binarisation, Threshold.

Expected: success.
Observed "Threshold filter can be applied to grayscale images only." error.

Any ideas?

Re: PNG "Threshold filter can be applied to grayscale images

PostPosted: Thu Jul 14, 2011 8:25 am
by andrew.kirillov
chrisjj wrote:Observed "Threshold filter can be applied to grayscale images only." error.

It seems like your image is not grayscale. The fact that it looks like a grayscale does not mean that its format is graysalce. If you use Windows, you can check properties of your PNG file. If it says 24 or 32 bpp image, than it is no way grayscale. In this case just do grayscaling from IPLab.

Re: PNG "Threshold filter can be applied to grayscale images

PostPosted: Thu Jul 14, 2011 1:59 pm
by chrisjj
andrew.kirillov wrote:It seems like your image is not grayscale. The fact that it looks like a grayscale does not mean that its format is graysalce.

I created it in Paint Shop Pro as 8bit Grayscale. I checked it with PNG Analyser, which confirmed it was 8bit Grayscale. I checked it in a hex editor, and the chunk data at offset (from the PNG spec) dec 24,25 is hex 08,00, confirming it is 8bit Grayscale.

andrew.kirillov wrote:If you use Windows, you can check properties of your PNG file. If it says 24 or 32 bpp image, than it is no way grayscale.

Windows Explorer file Properties Summary Bit Depth does say 32, but I think this is inaccurate because it says that for all images IDed as 8-bit Grayscale by all other porgrams I've tried.

Here is my failing image
Image.

If you have a succeeding image, I would like to try it.

Thanks Andrew.

Re: PNG "Threshold filter can be applied to grayscale images

PostPosted: Thu Jul 14, 2011 2:58 pm
by andrew.kirillov
chrisjj wrote:Windows Explorer file Properties Summary Bit Depth does say 32, but I think this is inaccurate because it says that for all images IDed as 8-bit Grayscale by all other porgrams I've tried.

It also recognizes 24 bpp images ;)

Anyway, not sure can be of help. If .NET loads it as 32-bit image, then IPLab gets 32-bit image. IPLab does not use any custom code for PNG loading/saving - all comes from .NET.

As I said before - do grayscaling in IPLab. It is just one button click on toolbar.

Re: PNG "Threshold filter can be applied to grayscale images

PostPosted: Sat Jul 16, 2011 12:46 pm
by chrisjj
OK, thanks. Suggestion for improvement: remedy File Open's conversion of grayscale into coloured.