[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #36820] imread doesn't consider opacity in Mag
From: |
Andreas Weber |
Subject: |
[Octave-bug-tracker] [bug #36820] imread doesn't consider opacity in Magick::BilevelType, Patch included |
Date: |
Tue, 10 Jul 2012 08:37:49 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20100101 Firefox/10.0.5 Iceweasel/10.0.5 |
URL:
<http://savannah.gnu.org/bugs/?36820>
Summary: imread doesn't consider opacity in
Magick::BilevelType, Patch included
Project: GNU Octave
Submitted by: andy1978
Submitted on: Di 10 Jul 2012 08:37:48 GMT
Category: Libraries
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Assigned to: None
Originator Name: Andreas Weber
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: GNU/Linux
_______________________________________________________
Details:
$hg id
c3fd61c59e9c+ tip
I've attached an image "rect.png" of type Magick::BilevelType. When imread in
octave, the return value is empty(all zero):
octave:1> pic=imread("rect.png");
warning: your version of GraphicsMagick limits images to 16 bits per
pixel
octave:2> min(pic(:))
ans = 0
octave:3> max(pic(:))
ans = 0
octave:4> imfinfo("rect.png")
ans =
scalar structure containing the fields:
Filename =
/home/andy/Holografie/doc/Experimente/ShowHologramFromPNG/rect.png
FileModDate = 26-Mar-2012 17:03:18
FileSize = 9053
Height = 600
Width = 800
BitDepth = 8
Format = PNG
LongFormat = Portable Network Graphics
XResolution = 35.430
YResolution = 35.430
TotalColors = 1
TileName =
AnimationDelay = 0
AnimationIterations = 0
ByteOrder = undefined
Gamma = 0.45455
Matte = 1
ModulusDepth = 8
Quality = 75
QuantizeColors = 256
ResolutionUnits = undefined
ColorType = grayscale
View =
output of gm identify
$gm identify rect.png
rect.png PNG 800x600+0+0 DirectClass 8-bit 8.8K 0.000u 0:01
In __magick_read__.cc:220 there is a switch for BilevelType and GrayscaleType.
Afterwards, the red channel of PixelPacket is read but it looks to me taht
instead opacity should be used (red is always zero) when type==BilevelType.
The attached patch solves my problem but I'm not really sure about the side
effects.
Perhaps we can include some small sample images of various types and run some
tests against them?
Andy
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Di 10 Jul 2012 08:37:48 GMT Name: rect.png Size: 9kB By: andy1978
<http://savannah.gnu.org/bugs/download.php?file_id=26174>
-------------------------------------------------------
Date: Di 10 Jul 2012 08:37:48 GMT Name: magick_read_BilevelType_opacity.patch
Size: 904B By: andy1978
<http://savannah.gnu.org/bugs/download.php?file_id=26175>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?36820>
_______________________________________________
Nachricht gesendet von/durch Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #36820] imread doesn't consider opacity in Magick::BilevelType, Patch included,
Andreas Weber <=