AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

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

Forum to discuss Image Processing Lab (IPLab) application, its features, etc.

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

Postby chrisjj » Thu Jul 14, 2011 12:35 am

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?
chrisjj
 
Posts: 7
Joined: Thu Jul 14, 2011 12:23 am

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

Postby andrew.kirillov » Thu Jul 14, 2011 8:25 am

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.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3443
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

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

Postby chrisjj » Thu Jul 14, 2011 1:59 pm

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.
chrisjj
 
Posts: 7
Joined: Thu Jul 14, 2011 12:23 am

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

Postby andrew.kirillov » Thu Jul 14, 2011 2:58 pm

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.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3443
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

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

Postby chrisjj » Sat Jul 16, 2011 12:46 pm

OK, thanks. Suggestion for improvement: remedy File Open's conversion of grayscale into coloured.
chrisjj
 
Posts: 7
Joined: Thu Jul 14, 2011 12:23 am




Return to IPLab