NicoKandut / factorio-solar-art

Converts pictures into blueprints for solar farms.
https://nicokandut.github.io/factorio-solar-art/
MIT License
42 stars 1 forks source link

Improve brightness (luminescence) calculation #9

Closed msarchet closed 2 years ago

msarchet commented 2 years ago

Was looking at your code in how you calculate brightness. R+G+B/255/3 isn't accurate as to how humans perceive luminescence. A more accurate formula is as follows.

L=0.2126R_+0.7152G_+0.0722*B from Relative Luminance

Happy to make an attempt at this change and go through some comparison of the results.

NicoKandut commented 2 years ago

Wow. I had no idea. Would love to see the improvements

msarchet commented 2 years ago

It's a little tricky to show 1:1 comparisons as the brightness changes cause the overall solar to accumlator ratios to change. So I got the sliders into similar positions

New Version

image

Old Version

image

Due to Red and Purple being effectively dark values to the human eye, they always show up as solar from the calculator.

There could be some improvements made to counteract that.

Additional Images

New

image

Old

image

New

image

Old

image

What I notice most is there is less noise in the resulting blue print

NicoKandut commented 2 years ago

Nice! Good work man.

NicoKandut commented 2 years ago

There could be some improvements made to counteract that.

I was thinking of different rendering modes. Kinda like the Space exploration one.

I wanna do a Halftone effect at some point, kinda like this:

halftone