Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
ReX

XWE & transparency in png images

Recommended Posts

Csabo, here's what I did:

    1. I designated a color in my png image as transparent (in this case RGB = 0, 0, 255) and saved the image.
    2. I used XWE beta to load the patch in raw data format and automatically create the PNAMES & TEXTURE1 lumps. XWE did all of that just fine, and the patch displays the transparent sections exactly as intended.
    3. I used XWE v1.16 (yes, I find a good use for it) to load the patch in a second wad and create the PNAMES & TEXTURE1 lumps. It does all of that, and as I wanted it to do it converted the png image into the DooM graphics format. Unfortunately, it did not recognize the transparent areas, which continue to be shown in dark blue (RGB = 0, 0, 255).
Can you please tell me why this might be happening? I.e., why is the patch in raw data format correctly showing the transparent areas, but the patch in DooM graphics format not correctly showing it?

If necessary I will manually edit each of the graphics with transparency in them, and replace the RGB = 0,0,255 with cyan, but I wanted to know if there was a less tedious way. Thanks.

Share this post


Link to post

And here's another twist to an already very weird tale. Last night I had inserted the png image as described in Step 1 of my previous post, fired up GZDooM, and admired my work in all its OpenGL glory.

This morning I tried to run the second wad with the converted DooM graphics format textures, and GZDooM crashed hard. The screen froze with diagonal striated colors and no message. It took almost half a minute to be able to even bring up the menu to exit. I know this is a question for the GZDooM forum, but I believe it is related to the problem I described in my previous post in this thread - the lack of correct transparent area designation in the converted graphic.

Also, when I open the first wad (i.e. with the png in raw data format) in XWE v1.16, the transparency does not show (i.e., the RGB = 0,0,255 color appears in the transparent areas), but XWE Beta displays it correctly.

In case you're wondering, I keep XWE v1.16 because I need to retain the ability to load png format images and have XWE convert them into DooM Graphics Format, and not automatically load them in raw data format (as XWE Beta does). In other words:

    1. XWE V1.16 allows me to load a large number of png files into a wad, convert them into DGF, and correctly make the entries in the PNAMES & TEXTURE1 lumps, while
    2. XWE Beta allows me to load a large number of png files into a wad in raw data format, and correctly make the entries in the PNAMES & TEXTURE1 lumps
Both versions allow me to load individual (or several) png images in raw data format, but then I would need to manually insert the entries in the PNAMES & TEXTURE1 lumps.

Share this post


Link to post
ReX said:

Both versions allow me to load individual (or several) png images in raw data format, but then I would need to manually insert the entries in the PNAMES & TEXTURE1 lumps.


As a work around until this is sorted (assuming it is)... could you import in Doom graphics format to generate the texture1 and pnames and then remove and re-import the pngs as raw and use the texture1 and pnames lumps generated by the previous import?

Share this post


Link to post
Enjay said:

As a work around until this is sorted (assuming it is)... could you import in Doom graphics format to generate the texture1 and pnames and then remove and re-import the pngs as raw and use the texture1 and pnames lumps generated by the previous import?

Yes, that is certainly a workaround, although a theoretical one at this point. As you know, I am working with two identical resource wads, one with png images in raw data format and the other with the images converted into DGF. I'd already succeeded in created these two wads relatively easily:

    1. The first by using the XWE Beta, which allows mass importing in raw data format while simultaneously creating the relevant PNAMES & TEXTURE1 entries, which makes the process so much easier. Csabo had incorporated this feature at my request.
    2. The second wad was created by using XWE v1.16 to mass import the same images. This version of XWE automatically converts from raw data format to DGF while also simultaneously creating the relevant PNAMES & TEXTURE1 entries.
I guess the problem I was highlighting in this thread was the inability of XWE V1.16 to correctly display transparency correctly in png (raw format) graphics, even though it has the ability to import png images in raw format. The (admittedly small) problem it poses for me is that, for the second wad, when I see the texture in my map editor it does not have the transparent areas. Worse, if I choose to run this version using GZDooM the whole shebang crashes hard. No problem with ZDooM, however.

Running the first wad (which will be the one I upload/distribute) should work like a charm.

Share this post


Link to post

As for your original request: XWE's method of finding what's transparent used to be pretty simple: 00FFFF and FC00FC is transparent. (The second is Duke's magenta color.) However, what you were suggesting is doable, so I added it to the latest beta. Now, in addition, if the image is a PNG, and it uses a single transparent color, that will be also transparent in the resulting DFG file, regardless of the actual RGB value.

The rest I'm a bit confused about... Is there question or request there? Also, the latest can do everything 1.16 can do. If you want the PNGs to be converted to DGF upon import, just (temporarily) turn off the option. Or, if you're planning on doing this a lot, just turn off the option altogether, and use Load when you need DGF and Load Raw when you need PNG.

Share this post


Link to post
Csabo said:

As for your original request: XWE's method of finding what's transparent used to be pretty simple: 00FFFF and FC00FC is transparent. (The second is Duke's magenta color.) However, what you were suggesting is doable, so I added it to the latest beta. Now, in addition, if the image is a PNG, and it uses a single transparent color, that will be also transparent in the resulting DFG file, regardless of the actual RGB value.

So if I understand you correctly, now when XWE imports a png file and converts it to DGF it automatically recognizes and correctly assigns the transparency to the designated color. Very cool.

The rest I'm a bit confused about... Is there question or request there?

It was more of a question pertaining to what I perceived as a limitation of XWE v1.16, which otherwise does what it's supposed to do with png in raw data format. As you've obviously moved well past v1.16, I suppose it was more a hypothetical/rhetorical question.

Also, the latest can do everything 1.16 can do. If you want the PNGs to be converted to DGF upon import, just (temporarily) turn off the option. Or, if you're planning on doing this a lot, just turn off the option altogether, and use Load when you need DGF and Load Raw when you need PNG.

Yes, now that you mention it I do recall you indicating there was a new option to turn the "import in raw data format" on or off. I was hesitant to make one more feature request, so I'm glad to see that it's already in there. With all that the Beta can do I agree that there's less reason to keep XWE v1.16 around. Thanks.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×