Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps exported as RGBA and waste a lot of space #278

Closed
qwiglydee opened this issue Feb 5, 2019 · 2 comments
Closed

Maps exported as RGBA and waste a lot of space #278

qwiglydee opened this issue Feb 5, 2019 · 2 comments
Labels
enhancement New feature or request exporter This involves or affects the export process

Comments

@qwiglydee
Copy link

qwiglydee commented Feb 5, 2019

MetallicRoughness map has 2 channels but exported with 4. Wasting 50% instead of possible 30%
Normal map has 3 channels but exported with 4. Wasting 25%.

@julienduroure julienduroure added enhancement New feature or request exporter This involves or affects the export process labels Feb 6, 2019
@donmccurdy
Copy link
Contributor

@qwiglydee what format are your original textures? This exporter should try to preserve the input textures, rather than converting to something else. If it's not doing that, we should fix it, but we'd like to avoid converting lossless PNGs to lossy JPEGs, and leave that to other optimization tools.

Also note – it's common to use PNG instead of JPEG for normal maps, lossy compression will often cause artifacts there. The size differences between JPEG and PNG are not as simple as the number of channels involved, there are cases where PNG may be smaller – e.g. textures with mostly solid colors.

@qwiglydee
Copy link
Author

I'm talking about number of channels, not format.
However, seems like I panic too much.
Here are results of a pure experiment:

original/color.png: PNG image data, 1024 x 1024, 8-bit/color RGB, non-interlaced
original/metallic.png: PNG image data, 1024 x 1024, 8-bit grayscale, non-interlaced
original/roughness.png: PNG image data, 1024 x 1024, 8-bit grayscale, non-interlaced
original/normal.png: PNG image data, 1024 x 1024, 8-bit/color RGB, non-interlaced
1460k total

gltf/color.png: PNG image data, 1024 x 1024, 8-bit/color RGB, non-interlaced
gltf/metallicroughness.png: PNG image data, 1024 x 1024, 8-bit/color RGBA, non-interlaced
gltf/normal.png: PNG image data, 1024 x 1024, 8-bit/color RGB, non-interlaced
1616k total

The metallicroughness image has 4 channels and 2 of them unused.
However, the unused channels have only 1 bit depth.

  Type: TrueColorAlpha
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 8-bit
  Channel depth:
    red: 1-bit
    green: 8-bit
    blue: 8-bit
    alpha: 1-bit

Nothing much to worry about, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exporter This involves or affects the export process
Projects
None yet
Development

No branches or pull requests

3 participants