I'm trying to create 'sprites', which are graphic objects with shapes other
than just rectangles. As such, I need to be able to establish a transparent
color.
So, I create images using Photoshop, make the area I want transparent black.
But when I store them as jpg files, it seems to store it it a format that is
different from other jpg files. The reason I know this is that if I save it
using Photoshop the icon for it is NOT a thumbnail but a red X. If I load
this file into Paint and just save it back out, THEN it has a thumbnail in
its listing! Obviously, something changed, and for some reason Photoshop
doesn't put out the same jpg as Paint does.
Anyway, I take such images and load them into a Bitmap, and change the
transparent color to Color::Black (I'm using VC++ 2005 Express, managed). I
can see that this WOULD work. That's because an image I've saved using
Photoshop, and then loaded and saved using Paint, results in some of the
black pixels still being pure black, so are transparent. This proves that
Black IS transparent. But it looks like most of the black in the image is
converted to close-to-black (probably as a result of the lossy nature of
jpg), which of course is NOT transparent, resulting in ugly fringes.
Oddly, my version of Photoshop does not seem to have an option to save in
bmp format (a format which is not lossy). That might work too...
Any hints on how to create an image file and forcing black areas to remain
black? Thanx!
Peter Oliphant - 24 Sep 2007 18:38 GMT
Well, I was able to solve my problem, though it is a bit convoluted...
I first edit the picture in Photoshop. Then I save it as a jpg, and load it
in using MS Paint. I then save it out unchanged as a jpg. I then load it in
using Photoshop again. NOW, it allows me to save in BMP format. I make sure
all the transparent pixels are pure black, and re-save in bmp format.
Then the transparencies work since they aren't changed due to lossy
compression...
[==P==]
> I'm trying to create 'sprites', which are graphic objects with shapes
> other than just rectangles. As such, I need to be able to establish a
[quoted text clipped - 22 lines]
> Any hints on how to create an image file and forcing black areas to remain
> black? Thanx!
Brian Muth - 24 Sep 2007 19:17 GMT
This shouldn't be necessary.
Peter, in Photoshop, check the "Image", "Mode" and make sure it is set to RGB. I think if it is set to CMYK you run into issues like
you describe...
Brian
> Well, I was able to solve my problem, though it is a bit convoluted...
>
[quoted text clipped - 24 lines]
>>
>> Any hints on how to create an image file and forcing black areas to remain black? Thanx!
Peter Oliphant - 28 Sep 2007 17:23 GMT
Yup, that helped a LOT! As you've said, as long as I do everything in RGB
mode (and not CYMK) I'm allowed to save to BMP files, which is loss-less in
compression, and so doesn't change black to near-blacks..
THANX! : )
[==Peter ==]
> This shouldn't be necessary.
>
[quoted text clipped - 43 lines]
>>> Any hints on how to create an image file and forcing black areas to
>>> remain black? Thanx!