- Home /
WWW 16 bits textureformat download possible?
Is it possible to download textures which are 16bits into a 16bits texture directly?
Right now, when its downloaded its always 32 bits. Which is silly, since I want the 16bits. SO I need to convert it to another texture...
Can it be done in one go?
The texture I download is in 16bits format.
When its downloaded the www.texture.textureformat is 32 bits
When I make a 16bits texture and use LoadImageIntoTexture it becomes a 32bits texture!
Answer by jonas-echterhoff · Feb 21, 2011 at 07:39 PM
You could use an AssetBundle to download assets exactly as you imported them into Unity. Why do you require your textures to be in 16 bit format?
Edit: AssetBundles are indeed a Pro only feature. But, to save memory, compressed textures are much more useful then 16-bit textures anyways, as they are smaller and natively supported by the GPU. compressed textures can be loaded using WWW.LoadImageIntoTexture!
Its for the iPhone. I need to save memory. Unfortunately I need to download textures from a website. I can only preprocess them with a .NET tool I build for this purpose.
IS there a way to generate on your own (outside of Unity) assetbundles? (I guess not since its a Pro feature)
I edited my answer with more information based on your comments.
Answer by Eric5h5 · Feb 21, 2011 at 06:50 PM
No, 16-bit is not supported for downloads through WWW. There's no such thing as a 16-bit JPG or PNG anyway.
Good point, I would like to point out the following though: I use a .NET tool to download and process images from a website that I need in the app. When I set the bitformat to System.Drawing.Imaging.PixelFormat.Format16bppRgb565 the SIZE of the fileis 92.7 $$anonymous$$b versus 172.3 $$anonymous$$b when I use the default format. Based on this I assumed (perhaps wrongly) that there is such a thing as 16bits .jpg, otherwise I cant explain it.
@rudolfwm: JPG simply does not store data in bits like that. It doesn't even use RGB, ins$$anonymous$$d it stores image data as luma and chroma info, represented with discrete cosine transforms. You can specify lesser or greater amounts of compression, but not bit depth.