Photoshop, JPG, and transparent color

P

Peter Oliphant

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!
 
P

Peter Oliphant

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==]
 
B

Brian Muth

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


Peter Oliphant said:
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==]

Peter Oliphant said:
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!
 
P

Peter Oliphant

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 ==]

Brian Muth said:
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


Peter Oliphant said:
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==]

Peter Oliphant said:
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top