Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / September 2007

Tip: Looking for answers? Try searching our database.

Photoshop, JPG, and transparent color

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Oliphant - 24 Sep 2007 17:15 GMT
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!

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.