You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that the alpha value was ignored (premultiplied alpha)
staticinlinevoidcolor_tone(uint32_t &src_pixel, Tone tone, int rs, int gs, int bs, int as) {
uint8_t a = (src_pixel >> as) & 0xFF;
uint8_t r = ((uint32_t)hard_light.table[tone.red][(src_pixel >> rs) & 0xFF]) * a / 255;
uint8_t g = ((uint32_t)hard_light.table[tone.green][(src_pixel >> gs) & 0xFF]) * a / 255;
uint8_t b = ((uint32_t)hard_light.table[tone.blue][(src_pixel >> bs) & 0xFF]) * a / 255;
src_pixel = ((uint32_t)r << rs) | ((uint32_t)g << gs) | ((uint32_t)b << bs) | ((uint32_t)a << as);
}
Unfortunately that multiply will make the blit even slower. Will do some benchmarking to figure out how bad it is and if special-casing a = 255 will help.
Also refactor ToneBlit function structure.
Replaced ImageOpacity::Partial with Alpha_1Bit and Alpha_8Bit.
This allows further optimisations in Tone Blit to decide if premultiply is needed or not.
Benchmarks have shown that on x86 the difference is not measurable between multiply or not.
Maybe helps on other platforms with slower multiply.
FixEasyRPG#2755
Just put an pic with alpha channel, and modify its tint, via pic or tint screen.
This is an example of a pic imported normally:

And I set its pic properties and:

Video showing how tint screen transform the normal picture to the bugged pone:
https://user-images.githubusercontent.com/18174790/160157150-41f5ddb8-0c38-4fd6-9db6-266868f364cb.mp4
Thanks.
The text was updated successfully, but these errors were encountered: