Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Transparent images in Windows  (Read 8021 times)

0 Members and 1 Guest are viewing this topic.

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Transparent images in Windows
« on: February 05, 2011, 02:18:58 PM »

I am creating a dialogue window, with some similarities to GITS.

I plan to have the two participants portraits at the top and bottom of the screen. I want to create an effect, a rectangle that starts black behind the image portrait and fades as it goes away from it.

I am using the blend tool of GIMP to crate the image with the effect I want. I add transparency in its background and I have the result I want.
I create a window and then a static area with the size of my image. But, trying to add the image seems to have no results. The image path (interface/dialogue/dialoge.png) is added but I cannot see the image.

My questions are:
1)Does Wintermute support this or do I have to use a workaround?
2)How should I export the image in GIMP so that Wintermute can handle such effects? (so far I have been trying .png, since .jpg cannot handle transparency).
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Transparent images in Windows
« Reply #1 on: February 05, 2011, 02:51:54 PM »

Wintemute does support png files with transparency of course. You can upload the file to check if it's ok.
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Transparent images in Windows
« Reply #2 on: February 05, 2011, 03:04:41 PM »

Or at least a screenshot of what you're trying to achieve, because I don't quite understand from the description.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Transparent images in Windows
« Reply #3 on: February 05, 2011, 11:38:44 PM »

if you save the image as a png file with RGBA, you'll get the desired effect. Note that jpg files don't support transparency.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Transparent images in Windows
« Reply #4 on: February 06, 2011, 02:42:21 AM »

I was talking about something like this: http://www.ghostinthesheet.com/dialog.jpg

metamorphium, how do I create that transparent rectangle that is placed behind the actor's portrait and contains the dialogue text?

What I do in GIMP is create an image with the right dimensions, filling it with black colour and reducing the layer opacity. In GIMP it shows it as I wish but exporting it to .png creates a grey image. I do not understand what you mean by RGBA.

As for why it was not visible when I added the image in the Window, I think that particular .png I tested was exported in a way that Wintermute cannot recognize.

Thank you all for your responses and I hope you can help me further.
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Transparent images in Windows
« Reply #5 on: February 06, 2011, 10:52:55 AM »

I used the default png export options of gimp and the file works perfectly fine in wme. Can you please upload your png to check it?
Logged
fl*p

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Transparent images in Windows
« Reply #6 on: February 06, 2011, 01:53:04 PM »

I solved the issue where I set an image to a static control and it did not show, it was something stupid on my behalf  :-[

But, from what I have found so far, .png cant handle opacity. I get this warning whenever I export a .png from GIMP. It just exports an image with grey background and that is also how Wintermute shows it in the game.


Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Transparent images in Windows
« Reply #7 on: February 06, 2011, 02:07:10 PM »

As I already said I used the default png export settings of gimp and the png has transparency and it works perfectly fine in wme.
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Transparent images in Windows
« Reply #8 on: February 06, 2011, 02:14:34 PM »

But, from what I have found so far, .png cant handle opacity.
PNG format definitely CAN handle opacity. I'm not familiar with Gimp, but perhaps you're using some conflicting options when saving the file?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Transparent images in Windows
« Reply #9 on: February 06, 2011, 02:23:49 PM »

anarchist, I am using Gimp for transparent PNG's all the time.

Simple google search would immediately yield for example this:
http://www.ehow.com/how_7717232_save-transparent-png-gimp.html
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Transparent images in Windows
« Reply #10 on: February 06, 2011, 03:43:40 PM »

I have searched this multiple times and the results I always get is how to make some parts of the image fully transparent, while what I am looking for is for a black image than is see through (like the rectangle in the GITS dialogue), so I can place my dialogue text inside it.
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Transparent images in Windows
« Reply #11 on: February 06, 2011, 03:50:26 PM »

I have searched this multiple times and the results I always get is how to make some parts of the image fully transparent, while what I am looking for is for a black image than is see through (like the rectangle in the GITS dialogue), so I can place my dialogue text inside it.

As I have mentioned twice, I did exactly that using the default png export of gimp and it works as it should. Please upload your png file to check it.
Logged
fl*p

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Transparent images in Windows
« Reply #12 on: February 06, 2011, 04:02:13 PM »



This is one of the images I have been working. Obviously it is not transparent. Could you please upload a working example?
« Last Edit: February 06, 2011, 04:04:44 PM by anarchist »
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Transparent images in Windows
« Reply #13 on: February 06, 2011, 04:52:35 PM »

This file strange. I have no time to check it further but for some reason only photoshop sees it as transparent. For everything else it's just RGB 0,0,0. I created those files http://dl.dropbox.com/u/7421572/black.zip using gimp (2.7.1unstable) and they work in wme. I created a 1024x100 file, made it black RGB 0,0,0, changed opacity and exported to png using the default png settings.
Logged
fl*p

anarchist

  • Regular poster
  • ***
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 212
    • View Profile
Re: Transparent images in Windows
« Reply #14 on: February 06, 2011, 05:57:25 PM »

Thanks odnorf those files work perfectly and thanks everybody for your answers. Sorry to be a bother but it was annoying not being able to do something so trivial. If I find out was I was doing wrong I will let you know.
Logged
 

Page created in 0.067 seconds with 22 queries.