Page 1 of 1
DDS format / mipmaps parameter
Posted: 2015-03-08T14:47:23-07:00
by florianlabas
Hi,
i''m trying the convert files to DDS
and it seems that dds:mipmaps is not working
convert -format dds -define dds:mipmaps=5 -define dds:compression=dxt1 Sudoku1.png Sudoku1.dds
dds:compression works fine, but not mipmaps
Have seen in the source code some "skip mipmaps", was it releavant ?
Thanks !
Re: DDS format / mipmaps parameter
Posted: 2015-03-08T22:59:15-07:00
by dlemstra
How do you know that the mipmaps are not working?
Re: DDS format / mipmaps parameter
Posted: 2015-03-09T00:21:17-07:00
by florianlabas
Hi,
I tried to load the DDS file under Photoshop with NVIDIA Texture extension that reveal mipmaps
Re: DDS format / mipmaps parameter
Posted: 2015-03-09T01:08:50-07:00
by dlemstra
Is the size of your image a square root of two?
Re: DDS format / mipmaps parameter
Posted: 2015-03-10T12:42:03-07:00
by florianlabas
Sure !
Re: DDS format / mipmaps parameter
Posted: 2015-03-19T10:46:42-07:00
by florianlabas
Hey there,
here's some output file
I test on severals DDS reader and i'm pretty sure IM don't generate mipmap
Is it a IM bug ?
Original image :
http://s000.tinyupload.com/?file_id=028 ... 6611448232
With IM
http://s000.tinyupload.com/?file_id=307 ... 6001547879
With Photoshop and Nvidia DDS creator
with mipmap
http://s000.tinyupload.com/index.php?fi ... 2832531134
without mipmap
http://s000.tinyupload.com/index.php?fi ... 6383862298
Re: DDS format / mipmaps parameter
Posted: 2015-03-19T10:49:55-07:00
by florianlabas
Of course, here's the square of 2 management :
Code: Select all
LImage.SourceDimensionX = image.Width
LImage.SourceDimensionY = image.Height
Dim width_def As Integer = LImage.SourceDimensionX
Dim height_def As Integer = LImage.SourceDimensionY
If (LImage.SourceDimensionX Mod 4 > 0) Then width_def = LImage.SourceDimensionX - (LImage.SourceDimensionX Mod 4) + 4
If (LImage.SourceDimensionY Mod 4 > 0) Then height_def = LImage.SourceDimensionY - (LImage.SourceDimensionY Mod 4) + 4
If (width_def > LImage.SourceDimensionX) Or (height_def > LImage.SourceDimensionY) Then
image.Extent(width_def, height_def, Gravity.Center)
End If
Re: DDS format / mipmaps parameter
Posted: 2015-03-19T12:02:22-07:00
by dlemstra
That code does not look valid. Your image should be square and be a power of two. (128, 256, 512). Sorry for using an incorrect term earlier, English is not my native language.
Re: DDS format / mipmaps parameter
Posted: 2015-03-19T13:42:34-07:00
by snibgo
?? 128 and 512 are powers of 2, but are not squares. Number that are both square, and powers of 2, would include 4, 16, 64, 256, 1024.
Re: DDS format / mipmaps parameter
Posted: 2015-03-19T13:54:05-07:00
by dlemstra
The image should be square e.g. 128x128, 256x256. Once more I apologize for the confusion...