.PNG.PHYRE Imagine format

var prgmr == true;
var i = int;
for (i = 0; i < prgmr.knwldge; i++) {
prgrmr + i";
}
User avatar
Gu4n
Posts: 129
Joined: Wed Jul 08, 2015 5:25 am

.PNG.PHYRE Imagine format

Post by Gu4n » Sat May 14, 2016 7:25 pm

Hello! I'm trying to 'extract' the PNG file in a .PNG.PHYRE file, but I'm not sure how to do this.

Is someone familiar with the format and willing to instruct me on how to proceed? Thanks!

File: vis115.png.phyre

flamethrower
Programmer
Posts: 995
Joined: Mon Mar 09, 2015 3:03 pm

Re: .PNG.PHYRE Imagine format

Post by flamethrower » Sat May 14, 2016 9:08 pm

I looked but could not figure it out.
Image data starts at 0xF8F, 32 bits per pixel, RGBA, and 1 million pixels exactly.
There's something going on here - I couldn't see the image.
I tried TiledGGD (would work if this is a tiled image - seems like it could be) but I can't find the right settings.

josejl
Programmer
Posts: 200
Joined: Mon Apr 13, 2015 6:49 pm
Location: Spain
Contact:

Re: .PNG.PHYRE Imagine format

Post by josejl » Sat May 14, 2016 11:05 pm

This is a PS3 file, right?
I guess the data is swizzled, and perhaps the mipmaps are there too.

flamethrower
Programmer
Posts: 995
Joined: Mon Mar 09, 2015 3:03 pm

Re: .PNG.PHYRE Imagine format

Post by flamethrower » Sat May 14, 2016 11:19 pm

How to unswizzle? Do you have real or pseudo code already that does it? Also, I did not know what a mip map is before looking it up.
I also don't understand swizzling. This wikipedia article is incomprehensible: https://en.wikipedia.org/wiki/Swizzling ... raphics%29
Didn't understand this one either: https://fgiesen.wordpress.com/2011/01/1 ... swizzling/
I don't think I'll be able to solve it.

josejl
Programmer
Posts: 200
Joined: Mon Apr 13, 2015 6:49 pm
Location: Spain
Contact:

Re: .PNG.PHYRE Imagine format

Post by josejl » Sat May 14, 2016 11:27 pm

On page 3 there is some explanation on that.
https://research.ncl.ac.uk/game/masters ... turing.pdf

Also I found this code in C:
http://asmodean.reverse.net/misc/_/exhappyend.zip

It won't work for this file as it is,but I see some similarities in there, perhaps I can get something from this.

User avatar
Gu4n
Posts: 129
Joined: Wed Jul 08, 2015 5:25 am

Re: .PNG.PHYRE Imagine format

Post by Gu4n » Sun Jun 12, 2016 11:16 am

I'm still looking into this, but all I can do is provide another example in case the first one is corrupted or anything.

https://drive.google.com/open?id=0Bw-dU ... G5sckExX2c

Based on what I've seen of the game so far, I think this should be a PNG file containing Alisa.

josejl
Programmer
Posts: 200
Joined: Mon Apr 13, 2015 6:49 pm
Location: Spain
Contact:

Re: .PNG.PHYRE Imagine format

Post by josejl » Sun Jun 12, 2016 6:22 pm

well,a lot of source code was missing,but I was able to find something to unswizzle in PhyreEngine code.

The way it's divided looks a bit off,but perhaps it's supposed to be like that in order to keep it 1024x1024?

I'll check if it works on the other one too
Attachments
vis1152.jpg
vis1152.jpg (148.82 KiB) Viewed 10137 times

josejl
Programmer
Posts: 200
Joined: Mon Apr 13, 2015 6:49 pm
Location: Spain
Contact:

Re: .PNG.PHYRE Imagine format

Post by josejl » Sun Jun 12, 2016 6:26 pm

Here goes the other one:
ch01.jpg
ch01.jpg (135.35 KiB) Viewed 10136 times

User avatar
Gu4n
Posts: 129
Joined: Wed Jul 08, 2015 5:25 am

Re: .PNG.PHYRE Imagine format

Post by Gu4n » Mon Jun 13, 2016 5:33 am

Wow, this is amazing and confirms my earlier assumption that the former is one of the few visuals not used in th final version of the game.

Would you mind elaborating the steps you've taken to achieve these results? That way, I can go through the remaining ones myself.

Great work, once again, josejl.

josejl
Programmer
Posts: 200
Joined: Mon Apr 13, 2015 6:49 pm
Location: Spain
Contact:

Re: .PNG.PHYRE Imagine format

Post by josejl » Mon Jun 13, 2016 8:18 am

I used the source code as the base,but it was missing quite a few key functions (the actual unswizzling for instance).

Also,what I got working right now is quite hacky,it outputs raw pixel data,so you can't open it using normal tools.
Also it's flipped upside down,but that can be fixed easily.

Also the file input is hardcoded right now,I have to fix that.

Would you be fine with png output? I think that shouldn't be too hard for me to add.

User avatar
Gu4n
Posts: 129
Joined: Wed Jul 08, 2015 5:25 am

Re: .PNG.PHYRE Imagine format

Post by Gu4n » Mon Jun 13, 2016 8:25 am

I'll take whatever I can get -- PNG output would be great. :)

josejl
Programmer
Posts: 200
Joined: Mon Apr 13, 2015 6:49 pm
Location: Spain
Contact:

Re: .PNG.PHYRE Imagine format

Post by josejl » Tue Jun 14, 2016 9:48 am

Here it is. Just drag a png.phyre over the exe file and it will write a png file (Vis115.png.phyre will output a Vis115.png file) . So far it only handles one file at a time.

If you need it,I can make some quick .bat so it can process all files in a folder (are all the files ended with .png.phyre?)

You might need to install Visual C++ 2015 runtime if it complains about some MSVC-something dll.
Attachments
phyre2png.rar
(118.13 KiB) Downloaded 423 times

User avatar
Gu4n
Posts: 129
Joined: Wed Jul 08, 2015 5:25 am

Re: .PNG.PHYRE Imagine format

Post by Gu4n » Tue Jun 14, 2016 10:07 am

Wow, this is amazing. Thank you so much. Having a .bat would speed up the process of converting a lot.

The files are either dae.phyre (for polygonal models), dds.phyre (textures, can be opened with TextureFinder) and these png.phyres.

josejl
Programmer
Posts: 200
Joined: Mon Apr 13, 2015 6:49 pm
Location: Spain
Contact:

Re: .PNG.PHYRE Imagine format

Post by josejl » Tue Jun 14, 2016 10:32 am

Here it is then, pretty straightforward I would say.
Attachments
batch.rar
(114 Bytes) Downloaded 362 times

User avatar
Gu4n
Posts: 129
Joined: Wed Jul 08, 2015 5:25 am

Re: .PNG.PHYRE Imagine format

Post by Gu4n » Tue Jun 14, 2016 10:42 am

Thanks a lot, for both making the conversion tool and making it so simple. I'm going to take it a spin tonight after work.

punk7890
Posts: 2
Joined: Sun Apr 23, 2017 6:01 am

Re: .PNG.PHYRE Imagine format

Post by punk7890 » Mon Apr 24, 2017 10:04 pm

Does anyone have the batch file for this program that josejl made? I can't seem to download it anymore. I'd love to take a look and see if there is anymore unused graphics in CS2.

josejl
Programmer
Posts: 200
Joined: Mon Apr 13, 2015 6:49 pm
Location: Spain
Contact:

Re: .PNG.PHYRE Imagine format

Post by josejl » Sun Apr 30, 2017 11:41 am

I think I don't have it anymore, however, I made a texture dump for both CS1 and CS2

https://mega.nz/#F!zE0Fmbqb!RMSRkPxpPjp8baSEiYyQUQ

flamethrower
Programmer
Posts: 995
Joined: Mon Mar 09, 2015 3:03 pm

Re: .PNG.PHYRE Imagine format

Post by flamethrower » Sun Apr 30, 2017 7:00 pm

You'll have to excuse me for not knowing how to code properly.

Maybe try this?
https://pastebin.com/bsGAszSq

You need to know the image size to make it work, I think.

When Gu4n gave me this problem last year, I didn't know how to unswizzle.

I still don't have it figured out. Is Alisa supposed to be rotated in that sample image?
The rotated one is yx swizzle order and the upside-down one is xy swizzle order. Is that just how it is?
Attachments
output1.png
output1.png (526.06 KiB) Viewed 9310 times
output.png
output.png (499.61 KiB) Viewed 9310 times

josejl
Programmer
Posts: 200
Joined: Mon Apr 13, 2015 6:49 pm
Location: Spain
Contact:

Re: .PNG.PHYRE Imagine format

Post by josejl » Sun Apr 30, 2017 7:19 pm

Don't give it much thought, in some graphics systems, the y axis is inverted, that's why they appear upside down, so yeah, it's x-y

flamethrower
Programmer
Posts: 995
Joined: Mon Mar 09, 2015 3:03 pm

Re: .PNG.PHYRE Imagine format

Post by flamethrower » Mon May 01, 2017 1:54 am

If the image is really inverted, you'd just need to pass in the rows backwards (last row first). That's easy to do in Python, but it's left as an exercise for the reader :) Here's a hint:

If you do at the prompt:
l = [1,2,3]
l[::-1]
You get:
[3, 2, 1]

If the image is mirrored (both upside down AND backwards), you'd need to pass in backwards rows backwards. That's probably not too hard either.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest