TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Colour Science for Python

55 pointsby ctrijuequeover 10 years ago

3 comments

leni536over 10 years ago
Nice. Everybody who programs something that involves calculations with colours in any way should learn some colour science. It&#x27;s not hard in any way but lot&#x27;s of stuff are missed in most applications.<p>One of the most missed feature is the lack of using a linear colourspace when it is necessary, like scaling (especially scaling down) images [1] or calculating physical models (like the Phong model [2]) that implicitly imply a linear colourspace. Iceweasel 35 still doesn&#x27;t use a linear colourspace for scaling, there is a simple example image showing that [3] (try to zoom out). Last time I checked their SVG engine&#x27;s Phong model implementation (yes, SVG supports bump maps with custom lighting settings) was broken too. It was a long time ago, I submitted a bug report for it but somehow it was marked as a duplicate for a &quot;fixed&quot; bug so I do not think that it got fixed since then.<p>[1] <a href="http://www.4p8.com/eric.brasseur/gamma.html" rel="nofollow">http:&#x2F;&#x2F;www.4p8.com&#x2F;eric.brasseur&#x2F;gamma.html</a><p>[2] <a href="http://en.m.wikipedia.org/wiki/Phong_reflection_model" rel="nofollow">http:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Phong_reflection_model</a><p>[3] <a href="http://www.4p8.com/eric.brasseur/gamma-1.0-or-2.2.png" rel="nofollow">http:&#x2F;&#x2F;www.4p8.com&#x2F;eric.brasseur&#x2F;gamma-1.0-or-2.2.png</a><p>edit: formatting<p>edit: Found the reference renderings of the feDiffuseLighting filter [4]. In my Iceweasel 35 the SVG images are much darker than the prerendered png.<p>[4] <a href="http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObjectApproved/filters-diffuse-01-f.html" rel="nofollow">http:&#x2F;&#x2F;www.w3.org&#x2F;Graphics&#x2F;SVG&#x2F;Test&#x2F;20110816&#x2F;harness&#x2F;htmlObj...</a>
rprosperoover 10 years ago
I&#x27;ve used the ColorPy (<a href="http://markkness.net/colorpy/ColorPy.html" rel="nofollow">http:&#x2F;&#x2F;markkness.net&#x2F;colorpy&#x2F;ColorPy.html</a>) a bit before and had some good luck with it. Anyone know who colorpipe compares?
评论 #9044972 未加载
canavandlover 10 years ago
Also, check out <a href="http://colour-science.org/" rel="nofollow">http:&#x2F;&#x2F;colour-science.org&#x2F;</a><p>It has python implementations of a ton of colorspaces and transforms. Also some cool support for spectral data.