Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Saving floating point image data as DDS_ARGB_32F large file size unusable DDS #28

Closed
GijsVerheijen opened this issue Jun 9, 2017 · 15 comments

Comments

@GijsVerheijen
Copy link

GijsVerheijen commented Jun 9, 2017

ImageEngineImage img = new ImageEngineImage(memoryStream); img.Save(path, new ImageFormats.ImageEngineFormatDetails(ImageEngineFormat.DDS_ARGB_32F), MipHandling.Default);

I created an image 1920x1200 containing floating point rgb values, im trying to save them to a DDS using the ImageEngineImage but the export for "ImageEngineFormat.DDS_ARGB_32F" gives me a huge file (200mb+) . This file is not opening up in Photoshop or any other tool.

When I export the image data as Format RGBA8 it is working fine and the output DDS is usable (11mb). I need the RGB values in floating percision, any ideas?

@GijsVerheijen GijsVerheijen changed the title Saving floating point RGB as RGB32F large file size unusable DDS Saving floating point image data as DDS_ARGB_32F large file size unusable DDS Jun 9, 2017
@KFreon
Copy link
Owner

KFreon commented Jun 9, 2017

So saving as ARGB_32F doesn't work for your input data?
Could you provide a sample file for testing?

@GijsVerheijen
Copy link
Author

Added an example image

c

Also added a wetransfer link of the output, it doesnt allow me to upload a zip for some reason
https://wetransfer.com/downloads/e2b3fb9673eb5db8709737bd9ba593a120170612074910/46ce7f04eb209a8d108641485341040e20170612074910/6cfb86

@KFreon
Copy link
Owner

KFreon commented Jun 12, 2017

Alright. I'll take a look this week sometime.

@KFreon
Copy link
Owner

KFreon commented Jun 13, 2017

Ok I think I fixed it. I'll do some more testing, but this will be in the next update once I've figured out BC6 compression...

@KFreon
Copy link
Owner

KFreon commented Jun 16, 2017

Fixed!

@KFreon KFreon closed this as completed Jun 16, 2017
@GijsVerheijen
Copy link
Author

GijsVerheijen commented Jun 22, 2017

It is still producing an unknown image format for me, but the image size is significantly smaller (~200mb to 47mb)
`
ImageEngineImage img = new ImageEngineImage(@"C:/Desktop/combined.bmp");

img.Save(path, new ImageFormats.ImageEngineFormatDetails(ImageEngineFormat.DDS_ARGB_32F), MipHandling.Default);`

@KFreon
Copy link
Owner

KFreon commented Jun 22, 2017

Interesting. I got the rainbow image above and converted it to ARGB_32F with the tool, then opened it in the tool and in Photoshop, and it worked for me.
In what way are you getting it to break?

@GijsVerheijen
Copy link
Author

GijsVerheijen commented Jun 23, 2017

It is opening in Photoshop and in your tool but not in other tools such as PicoPixel and in the game engine im using which is using Ogre. Saving the file in photoshop makes the image usable in these programs. I noticed that the following items of the header change when I do this.

dwFlags: DDPF_ALPHAPIXELS, DDPF_RGB (Original, not working in engine and PicoPixel)
dwFlags: DDPF_FOURCC (After saving in Photoshop, working in engine and PicoPixel)

What im trying to do here is saving the image containing floating point data shouldnt the dwFlag be DDPF_FOURCC for floating point argb? See remarks section:

"To store DXGI formats such as floating-point data, use a dwFlags of DDPF_FOURCC and set dwFourCC to 'D','X','1','0'. Use the DDS_HEADER_DXT10 extension header to store the DXGI format in the dxgiFormat member."

source:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb943984(v=vs.85).aspx

@KFreon
Copy link
Owner

KFreon commented Jun 25, 2017

Hmm I'll take a look at how I do the headers. I thought it should already have those flags set, but evidently not.

@KFreon KFreon reopened this Jun 25, 2017
@KFreon
Copy link
Owner

KFreon commented Jun 28, 2017

OK I think I fixed it.

@GijsVerheijen
Copy link
Author

It is still doing something wrong with the conversion, if I convert im getting a distortion, but if I then convert the distorted image again, im getting a correct format. I have a download link with the results:
(https://we.tl/JvrK5ew9O9)
original.DDS
firstconversion.DDS (this one is distorted)
secondconversion.DDS (this is a conversion of the distorted image)

@KFreon
Copy link
Owner

KFreon commented Jul 3, 2017

What on Earth is going on here...
I'll see what I can do, no timeline atm though. Getting busy on my end.

@KFreon KFreon closed this as completed in 3c4554c Jul 21, 2017
@KFreon
Copy link
Owner

KFreon commented Jul 21, 2017

[Uploading Fix for ARGB32F.zip…](Give this one a go.) Should be fixed now.
I tested it in PicoPixel to be sure this time. Didn't read properly and missed that bit last time.

@GijsVerheijen
Copy link
Author

GijsVerheijen commented Jul 26, 2017

@KFreon Where can I find the link for the fix? Ill give it a go

@KFreon
Copy link
Owner

KFreon commented Jul 26, 2017

Oh that didn't work...How strange.
Fix for ARGB32F.zip

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants