Skip to content
New issue

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

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

Already on GitHub? # to your account

[Issue][drawicons][shadows] No sRGB support #16

Closed
shakesoda opened this issue Mar 31, 2015 · 10 comments
Closed

[Issue][drawicons][shadows] No sRGB support #16

shakesoda opened this issue Mar 31, 2015 · 10 comments

Comments

@shakesoda
Copy link

I poked at the demo and it didn't need too much to get most things working. The shadows didn't quite want to behave, might need an alternate version of the images for sRGB?

Gamma correct blending makes fonts look significantly better, for what it's worth.

@pablomayobre
Copy link
Owner

I have never played with sRGB, so I dont really know what it takes to turn an image from standard RGB to sRGB, have you got some info?

I'll try to look it up, currently the shadows are generated with an SVG file with inkscape and it is pretty customizable, I'll try to find a way to save it in sRGB.

@pablomayobre pablomayobre changed the title No sRGB support [shadows][Feature] No sRGB support Mar 31, 2015
@shakesoda
Copy link
Author

as far as love is concerned, you can check if the current window is sRGB using select(3, love.window.getMode()).srgb

then load the image using love.graphics.newImage(path, srgb and "srgb" or nil)

I don't know if Inkscape has proper sRGB support, but in PS there's an option to set the blending gamma, maybe see if you can find something like it?

the thing with the shadows is that the alpha values are too low, and with gamma correct blending they almost vanish.

@pablomayobre
Copy link
Owner

I'll try to find something like that (Maybe GIMP?)

If I can find it, I will make it a separate patch, I'll leave the option to the user, I cannot add it directly to the patch because that depends on the final game. If you change from RGB to sRGB and then back to RGB the patch would need to reload every time, if I load all the images then that is quite much, so it will depend on the final user whether to load the RGB patch or the sRGB

@shakesoda
Copy link
Author

Nobody changes to/from sRGB after the initial window creation, so there's really not much need to worry about reloading.

@pablomayobre
Copy link
Owner

Anyway I need to provide both, so doing it separately is not bad either, just change require "shadow" for require "shadow-srgb". The problem is the init.lua but it'll probably be a function, and if you pass "srgb" it will load shadow-srgb instead of shadow.

Is that fine?

@pablomayobre pablomayobre changed the title [shadows][Feature] No sRGB support [Feature][shadows] No sRGB support Jun 10, 2016
@Rami-Sabbagh
Copy link

This also applies to the icons ! They also fade when gamma correction is enabled.
love_2016-06-29_13-56-58
(The window on the left has gammacorrection enabled, and the one on the right not.)

@pablomayobre
Copy link
Owner

pablomayobre commented Jun 29, 2016

I see the problem.

For the images of the shadows, they are not loaded as sRGB images, and they weren't saved as such either.

For all the other stuff, gamacorrect rendering is not taken into account by the color.lua library which in turn is used by drawicons.lua which is what you use to draw the icons in place

This are easily fix, but I want support on saving the shadows as sRGB images, currently I'm using inkscape, I can give you the .svg if needed. The other stuff I can fix them tonight most provably

EDIT: The fab.lua library introduced in the last commit also has problem with sRGB

This shadows should be generated again with sRGB support but I've no idea how to do this as stated above

@pablomayobre pablomayobre changed the title [Feature][shadows] No sRGB support [Issue][drawicons][shadows] No sRGB support Jun 29, 2016
@Rami-Sabbagh
Copy link

This is the first time for me to set t.gammacorrect to true, I had fixed the drawicon problem by using love.math.linearToGamma() on the alpha value of the color.

For the shadow image thing, In gimp, there is a check box in the png export menu called save gamma, this may solve the problem, give me the svg file to give it a try.

@pablomayobre
Copy link
Owner

Didn't intend to close, Github interpreted a commit message as this being a fix, it's a start, two commits to go. shadow.lua should already be fixed

@pablomayobre
Copy link
Owner

Well that should do it! Please check it out and report back if you find any other issues.

PS: If this doesn't actually fix it feel free to reopen the issue

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants