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

block artifacts remains for certain image, even set -endpoint_rdo_thresh 1 #103

Closed
goldenyz opened this issue Jan 21, 2020 · 9 comments
Closed

Comments

@goldenyz
Copy link

Hi, we are trying to use '.basis' as our basic texture file format. But we found that there are some block artifacts for certain images:
original:
ldr-rgb-00-s
unpacked (ETC1_RGB):
ldr-rgb-00-s-m-e-100_unpacked_rgb_ETC1_RGB_0000

original:
ldr-rgb-03
unpacked (ETC1_RGB):
ldr-rgb-03_unpacked_rgb_ETC1_RGB_0000

command used:

./basisu ldr-rgb-03.png -comp_level 4 -max_selectors 16128 -max_endpoints 16128 -endpoint_rdo_thresh 1

could anyone help to find out why?

@slimbuck
Copy link

Try setting the quality level to maximum using argument "-q 255". This has the biggest effect on resulting image quality.

@goldenyz
Copy link
Author

goldenyz commented Jan 29, 2020

Try setting the quality level to maximum using argument "-q 255". This has the biggest effect on resulting image quality.

I have tried the argument. But the block artifacts remains.

@slimbuck
Copy link

Hi @goldenyz,
Yes I see. The compressed version of this image seems to have very nasty block compression artifacts. I'm sure @richgel999 could shed some light on why that is, but for what it's worth most color images I have tried have far fewer artifacts than you are getting here.

@goldenyz
Copy link
Author

goldenyz commented Jan 29, 2020

Hi @goldenyz,
Yes I see. The compressed version of this image seems to have very nasty block compression artifacts. I'm sure @richgel999 could shed some light on why that is, but for what it's worth most color images I have tried have far fewer artifacts than you are getting here.

Yes, the compressed version for most color images are acceptable. But in production, we may need a measurement for the acceptability. If the compressed image aren't acceptable, we can degrade into the original image... Do you have any recommendations for the measurement? It would be helpful for us, too.

@slimbuck
Copy link

Hi @goldenyz,

basisu supports the -stats flag which will output image quality metrics. Perhaps you could use that?

(I haven't used stats much myself).

@richgel999
Copy link
Contributor

richgel999 commented Jan 30, 2020

These look like typical ETC1S block artifacts. We only get 1 base color per 4x4 pixel block, and if there are large chroma transitions then block artifacts can show up. (Regular ETC1 has this issue too, except it occurs on 4x2 or 2x4 block boundaries.)

We're adding a HQ mode to Basis Universal within weeks, which will address this issue. Although the bitrate is going to be a lot higher (but will go down over time).

One thing that helps with this is to enlarge your texture with filtering.

(I'll grab your image in a bit and encode it myself.)

@richgel999
Copy link
Contributor

richgel999 commented Jan 30, 2020

Even BC1 is having block artifact problems with this texture - I recommend you enlarge it by 2x with filtering in Photoshop/PSP/etc. and try encoding it again:

unpacked_bc1_01

This was packed to BC1 using stb_dxt STB_DXT_HIGHQUAL.

@goldenyz
Copy link
Author

goldenyz commented Jan 31, 2020

@richgel999 Looking forward to the HQ mode. I have tried the encoding with ASTC 4*4 with medium in PVRTexTool, And the result seems acceptable:
ldr-rgb-00-s

Even BC1 is having block artifact problems with this texture - I recommend you enlarge it by 2x with filtering in Photoshop/PSP/etc. and try encoding it again:

unpacked_bc1_01

This was packed to BC1 using stb_dxt STB_DXT_HIGHQUAL.

Does this image is the result of enlarged 2x?

@richgel999
Copy link
Contributor

The UASTC build coming today fixes this - I highly recommend you give it a try once it's released. You can use uastc on problematic textures, and ETC1S on the others.

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

No branches or pull requests

3 participants