NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 17, 2017, 08:21:21 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  
You cannot always have happiness but you can always give happiness. ..."Mother Teresa(1910-1997, Roman Catholic Missionary, 1979 Nobel Peace Prize)"
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

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

Posts: 3

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

Hello!

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
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
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.
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
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!
Logged
Pages: [1]   Go Up
  Print  
You cannot always have happiness but you can always give happiness. ..."Mother Teresa(1910-1997, Roman Catholic Missionary, 1979 Nobel Peace Prize)"
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
How many images? (Multiple Reflection from two plane mirrors/different angle)
Optics
Fu-Kwun Hwang 2 20624 Last post August 07, 2012, 05:29:01 pm
by rocky123
Data images in project MetalicConductor
Questions related to EJS
ahmedelshfie 4 4016 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 14637 Last post September 26, 2010, 11:16:55 am
by DonaSima
Images by Reflection
Optics
Fu-Kwun Hwang 1 11219 Last post February 17, 2016, 04:25:17 pm
by allennicol
Regarding pin-hole images.
Request for physics Simulations
RUMI 5 5298 Last post December 31, 2014, 06:53:22 pm
by syedshah20
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 5.062 seconds with 23 queries.since 2011/06/15