Hi Charles,
Thanks for the quick response. I opened up a ticket. I don't know how
to attach images to the issue, so I provided a URL to the one in
question.
Yes, the image goes to near black in about 3-4 cycles.
Thanks again,
Kevin Theisen
Begin forwarded message:
From: "Charles Matthew Chen"
Date: August 3, 2008 1:17:25 PM PDT
To: "Kevin Theisen"
Subject: Re: Sanselan Issue
Hi there Kevin,
How are you? There's a few possible reasons for this.
Can you please open a ticket around this on JIRA (sanselan's issue
tracking system?
https://issues.apache.org/jira/browse/SANSELAN
Please attach the original source image (not that transition image
you attached to this email).
Also, let's move this conversation to sanselan-dev, the project's
mailing list.
One possible explanations come to mind: for grayscale images,
Sanselan's default behavior is to create a BufferedImage of type
TYPE_BYTE_GRAY. TYPE_BYTE_GRAY images have the unfortunate behavior
of slightly altering values. ie.:
"""
value1 = image.getRGB(x,y);
image.setRGB(x,y, value1);
value2 = image.getRGB(x,y);
// value1 != value2
// this code is from memory, I may have capitalization or param
order reversed.
"""
Just this week, I was considering how to best work around this. I'm
not sure this explanation addresses the problem you are seeing if that
png went to near-black in just 3 read-write cycles. The problem
around TYPE_BYTE_GRAY is akin to a rounding error and isn't likely to
shift a value more than 3 shades of gray.
Is that PNGDarker.png that you attached indicative of how quickly
the image darkens, ie. it goes to near black in just 3 cycles?
Charles.
On Sun, Aug 3, 2008 at 8:41 PM, Kevin Theisen wrote:
Hello Charles,
I have a quick questions about your great package. I am currently
using the
latest 0.94 version.
When saving and loading pngs with Sanselan, black and white images
get
darker with each save and load (view attached image). All images
are held in
memory as BufferedImages (ARGB). Have you ever seen this weird
behavior
before or how I may fix it?
Thank you so much,
Kevin Theisen
[EMAIL PROTECTED]