View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010917ITKpublic2010-06-30 08:162010-11-16 12:06
Reporteraurelien 
Assigned Tokentwilliams 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionITK-3-18 
Target VersionFixed in VersionITK-4-A2 
Summary0010917: Cannot read a RGBA png file into an itk::Image<unsigned char, 2> properly
DescriptionI tried to read a 4 channels (RGBA) png image file into an
itk:Image<unsigned char, 2> and the output image makes no sense. It
appears that it works fine with RGB png images. In fact, I located the
issue in ConvertPixelBuffer::ConvertRGBAToGray() that computes the
grayscale pixel value by applying the following formula:

((2125.0 * static_cast<double>RedPixelValue +
  7154.0 * static_cast<double>GreenPixelValue +
  0721.0 * static_cast<double>BluePixelValue)/1000.0) //OK
     * static_cast<double>AlphaPixelValue
//Here is the issue

In a RGBA png image, the range of AlphaPixelValue is [0,255]. The
resulting grayscale value is no longer reasonably allowed to be casted
into an unsigned char. That's why the reader output doesn't make any
sense. I isolated this behavior in the attachment.
Additional Informationa fix is pushed to gerrit
TagsNo tags attached.
Resolution Date2010-11-16
Sprint
Sprint Statuscompleted
Attached Filesgz file icon PngReadWriteBug.tar.gz [^] (43,437 bytes) 2010-06-30 08:16

 Relationships

  Notes
There are no notes attached to this issue.

 Issue History
Date Modified Username Field Change
2010-06-30 08:16 aurelien New Issue
2010-06-30 08:16 aurelien File Added: PngReadWriteBug.tar.gz
2010-11-02 14:14 Hans Johnson Status new => assigned
2010-11-02 14:14 Hans Johnson Assigned To => Gabe Hart
2010-11-02 14:15 Hans Johnson Assigned To Gabe Hart => kentwilliams
2010-11-04 12:43 kentwilliams Sprint Status => active
2010-11-04 12:43 kentwilliams Additional Information Updated
2010-11-16 12:06 kentwilliams Resolution Date => 2010-11-16
2010-11-16 12:06 kentwilliams Sprint Status active => completed
2010-11-16 12:06 kentwilliams Status assigned => closed
2010-11-16 12:06 kentwilliams Resolution open => fixed
2010-11-16 12:06 kentwilliams Fixed in Version => ITK-4-A2


Copyright © 2000 - 2018 MantisBT Team