MantisBT - ITK | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0010917 | ITK | public | 2010-06-30 08:16 | 2010-11-16 12:06 | |
Reporter | aurelien | ||||
Assigned To | kentwilliams | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | ITK-3-18 | ||||
Target Version | Fixed in Version | ITK-4-A2 | |||
Resolution Date | 2010-11-16 | ||||
Sprint | |||||
Sprint Status | completed | ||||
Summary | 0010917: Cannot read a RGBA png file into an itk::Image<unsigned char, 2> properly | ||||
Description | I 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. | ||||
Steps To Reproduce | |||||
Additional Information | a fix is pushed to gerrit | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | PngReadWriteBug.tar.gz (43,437) 2010-06-30 08:16 https://public.kitware.com/Bug/file/3217/PngReadWriteBug.tar.gz | ||||
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 |
There are no notes attached to this issue. |