The most impossible bug i never seen

16 views
Skip to first unread message

photo...@gmail.com

unread,
May 5, 2009, 3:18:13 PM5/5/09
to MathMap
It happens on Windows XP with MM-1.3.4, using the Colors_colorfly
filter

I believe is not a MM but a gimp bug ( colorfly seems buggy too,
because instead
then color convert to monochrome a colored image, but this is another
issue)

BUT i report also here since happens with MM

here all details and link to download original xcf and png

http://www.gimptalk.com/forum/viewtopic.php?f=2&t=40151&p=288153#p288153

Mark Probst

unread,
May 5, 2009, 3:39:58 PM5/5/09
to mat...@googlegroups.com
On Tue, May 5, 2009 at 9:18 PM, photo...@gmail.com
<photo...@gmail.com> wrote:
> I believe is not a MM but a gimp bug

It is neither. At best it's a bug in the colorify filter. What
happens is this:

Each pixel has four components - three color components (red, green,
blue), and a transparency component (called alpha). An opaque pixel
has an alpha value of 1, a completely transparent one an alpha of 0.
Values in between give varying degrees of transparency.

Apparently what Gimp did when you deleted the background was to set
background pixel's alpha to 0. It didn't change the RGB values,
though. After all, if a pixel is fully transparent it doesn't matter
what its "color" is. So all the filter has to do is to take the RGB
values and use an alpha value of 1 to restore the image, like so:

filter magic (image in)
p = in(xy);
rgba:[p[0], p[1], p[2], 1]
end

The moral of the story is that filters should honor alpha values.
Here's a properly working colorify filter:

filter colorify (image in, gradient colors)
p = in(xy);
c = colors((gray(p)+t)%1);
rgba:[c[0], c[1], c[2], c[3] * p[3]]
end

I cannot reproduce the problem with the PNG file, though.

> ( colorfly seems buggy too,
> because instead
> then color convert to monochrome a colored image, but this is another
> issue)

I don't understand what you mean here.

Mark

photo...@gmail.com

unread,
May 5, 2009, 3:48:11 PM5/5/09
to MathMap
thank to explain i was really puzzled

( colorfly seems buggy too,
> because instead
> then color convert to monochrome a colored image, but this is another
> issue)

>I don't understand what you mean here.

i had not clear what the "colorfly" filter should do
I supposed was intended to somehow add or change colors,
instead it converted from colors to BW


Mark Probst

unread,
May 5, 2009, 3:53:11 PM5/5/09
to mat...@googlegroups.com
On Tue, May 5, 2009 at 9:48 PM, photo...@gmail.com
<photo...@gmail.com> wrote:
>  i had not clear what the "colorfly" filter should do
> I supposed was intended to somehow add or change colors,
>  instead it converted from colors to BW

No, it uses the colors from your current Gimp gradient to colorify the
image. The brightness of each pixel determines which color in the
gradient it will be mapped to.

Mark

photo...@gmail.com

unread,
May 6, 2009, 11:15:56 AM5/6/09
to MathMap
That why as default give BW, default gradient is FG to BG color, so
black to white.
Rename the script as ColorFromGradient will help to understand its
possible use

On May 5, 9:53 pm, Mark Probst <mark.pro...@gmail.com> wrote:
> On Tue, May 5, 2009 at 9:48 PM, photoco...@gmail.com

Rob Antonishen

unread,
May 6, 2009, 1:13:43 PM5/6/09
to mat...@googlegroups.com
> On May 5, 9:53 pm, Mark Probst <mark.pro...@gmail.com> wrote:
>> On Tue, May 5, 2009 at 9:48 PM, photoco...@gmail.com
>>
>> <photoco...@gmail.com> wrote:
>> >  i had not clear what the "colorfly" filter should do
>> > I supposed was intended to somehow add or change colors,
>> >  instead it converted from colors to BW
>>
>> No, it uses the colors from your current Gimp gradient to colorify the
>> image.  The brightness of each pixel determines which color in the
>> gradient it will be mapped to.
>>
>> Mark

So does that make it equivalent to Colours->Map->Gradient Map ?

-Rob A>

Mark Probst

unread,
May 6, 2009, 4:02:26 PM5/6/09
to mat...@googlegroups.com
On Wed, May 6, 2009 at 7:13 PM, Rob Antonishen <rob.ant...@gmail.com> wrote:
> So does that make it equivalent to Colours->Map->Gradient Map ?

It seems it does.

Mark

Reply all
Reply to author
Forward
0 new messages