NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
January 23, 2021, 03:54:47 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
   Home   Help Search Login Register  
First time is the lat time. ...Wisdom
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
Author Topic: Need help with transparency of images  (Read 4677 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Offline Offline

Posts: 3

Embed this message
on: October 24, 2010, 11:40:54 pm » posted from:Hamburg,Hamburg,Germany


Right now I am programming a little game with a friend and there's a little problem with the transparency of images.
At the moment we've got a background and a protagonist, both as an image on our drawing panel.
Now the protagonist is a 20x15 pixel image and the unused pixel spots are still white.
Well these unused pixels in this image are visible on the background of course so there's always a rectangular white frame around our character.
Of course I could use PNGs which already got the transparency but GIFs for example are quite smaller.

In other pixelart games I saw a (mostly) very extreme color as a background in the spritesand somehow this was not be seen in the later background. So somehow the programm recognized this color and replaced it with the color of the real background beneath it.
Maybe that would be a nice approach but I really cannot figure it out myself

Thanks already for help  Smiley
Fu-Kwun Hwang
Hero Member
Offline Offline

Posts: 3086

Embed this message
Reply #1 on: October 25, 2010, 09:32:08 am » posted from:Taipei,T'ai-pei,Taiwan

It is different between white color and no color at all.

White Color =new java.awt.Color(255,255,255,255)

If the background of your image file is white, then all the color behind your image file will be blocked by the image file.
If there is no color added to the background of your image file, the color behind your image file can be shown as background.

Try to set the transparent parameter for the background color in your image file to 0 ,
then all the color behind the image will not be blocked by the background color in your image file.
Hero Member
Offline Offline

Posts: 1796


Embed this message
Reply #2 on: October 26, 2010, 02:26:21 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

i used  Gimp http://www.gimp.org/ to make the background transparent and save as png.

you can check out http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1501.0 which i remove the background of the planets by cropping in Gimp

good luck!
Pages: [1]   Go Up
First time is the lat time. ...Wisdom
Jump to:  

Related Topics
Subject Started by Replies Views Last post
How many images? (Multiple Reflection from two plane mirrors/different angle)
Fu-Kwun Hwang 2 23464 Last post August 07, 2012, 05:29:01 pm
by rocky123
Data images in project MetalicConductor
Questions related to EJS
ahmedelshfie 4 5502 Last post July 03, 2010, 10:21:35 am
by ahmedelshfie
Adding Ghost Trace images
Question related to Physics or physics related simulation
mickey2times 10 19805 Last post September 26, 2010, 11:16:55 am
by DonaSima
Images by Reflection
Fu-Kwun Hwang 3 14457 Last post October 31, 2020, 02:32:04 pm
by universityassignment
Regarding pin-hole images.
Request for physics Simulations
RUMI 6 7595 Last post October 24, 2020, 09:08:11 pm
by steve7876
Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.05 seconds with 22 queries.since 2011/06/15