Skip to main content

Posts

Showing posts from 2021

Windows的KVM软件

 KVM即是共享鼠标键盘。 之前Windows和Ubuntu我都是用Synergy,不过最近一查发现变成收费软件了。 Github上有个fork叫Barrier,下载以后配了好久也不好用。有可能跟我的屏幕配置有关系,一个电脑连了多个显示器,而且有的显示器还是禁用。最后放弃了。 后来搜到了微软的Mouse without Borders,简单配一下就能用了,还是不错。 网址是http://aka.ms/mm

Euclidea 14.5 解法与证明

Euclidea  14.5 如图,给定三个两两相切的圆,O,O_1, O_2。三个圆心共线。 任务:尺规作出一个圆,与给定的三个圆都相切。 解法: 设圆O与圆O_1的切点为A 连接OA 过O做OA垂线交圆O于D 以D为圆心,DA为半径作圆,交圆O_1和圆O_2于E和F。 作直线EO_1和FO_2交于G 以G为圆心,GE为半径作圆 圆G即为所求圆 简要证明: 如图,设三个圆切点为A,B,C。明显A,B,C,O,O_1,O_2五点共线。 以A为中心作反演变换,取反演圆与圆O_2正交。于是圆O_2经反演变换后不变。B,C互为反演点。 分别过B和C做AB的垂线L_B和L_C。易知圆O1和圆O经反演变换后分别为L_B和L_C。 如图作圆G'同时与圆O_2,L_B和L_C相切于E'和F'。 过E'F'作直线L,易证C在L上,并且∠E'CB为45°。 设L经过反演变换得到的圆为圆D',考虑圆D'的性质: 直线AD'与直线L垂直 圆D'经过A(因为L不经过A) 圆D'经过B(因为L经过C,而B,C互为反演点) 于是可知圆D就是圆D',因此E和E', F和F'分别互为反演点。 设圆G'经过反演变换为圆G''。因为圆G'与L_B和圆O_2相切于E'和F',所以圆G''与圆O_1和圆O_2相切于E和F。 所以G''即是EO_1和FO_2的交点,且圆G''半径是G''E。于是圆G即是圆G''。 因为圆G'与L_B,圆O_2,L_C都相切,所以圆G与三个给定圆都相切。证明完毕。 参考资料: Pappus chain

再度音乐寻宝

平时脑子里会无缘无故,不由自主地蹦出一些旋律。这些旋律很熟悉,也肯定不是自己现编的,但是就是想不起来具体的名字,歌手或者哪里听到的。 最简单的情况是记得歌词,或者可以哼唱检索。最难的大概是影视作品的配乐,我觉得成功的配乐会让人记得当时的“感觉”而不是曲子本身的细节。 继上次 音乐寻宝 之后,又一个旋律出现了,令我吃不香睡不着。 经过几天的查找,最终还是找到了,结果是井上昌己的《Up Side Down 永遠の環》,出自圣少女的ED。过程还是挺有趣的。 1. 我大概记得开头intro的旋律,以及歌词的整体节奏,类似词牌。然而试了若干哼唱检索,都没有结果。 2. 我大概记得一些歌词片段,于是去各种网站搜索。然而结果证明我记忆的片段是错误的。 3. 我“感觉”这是一个日本动画的ED, 于是去搜索了80 90年代引进的日本动画, 以及00-08年流行的日本动画的OP ED,然而没有找到。这个比较巧妙,因为圣少女国内引进过,但是节选了OP和ED。我其实也翻了日版动画,大概看了前几集和后几集的OP ED,万没想到结果是中间的。 4. 我“感觉”动画是跟魔法少女有关,所以翻了翻魔卡少女樱和Marybell的乐集,一无所获。当时其实也过了一遍圣少女的乐集,不知为何漏掉了。 5. 后来放宽了条件,搜了一些类型相似的动画乐集,虽然没找到当前这个,但是意外找到了我的女神里的《優しい心》。这个也是以前突然蹦出来的旋律。同时翻到了同作品里的《願い》,感觉跟要找的相似,然而其实没啥相似,除了都是欢快的曲子。 6. 于是放弃了,能试的都试了,只能随缘了。 7. 后来调整了下思维,想到有没有可能是其他类属性。于是翻了一下邓丽君的日文歌集,甚至《梅兰梅兰我爱你》,当然还是无果。 8. 最后真的是随了缘,重翻了一下圣少女的乐集,竟然找到了。 这个过程里我觉得最有趣的是两点: 一是我记忆里的“感觉”,日本动画, ED, 魔法少女。这样的记忆比曲子本身深刻一些。这也让找曲子更困难了一些。 二是我记忆里的不确定因素,包括旋律歌词。我试想过多种可能的乐器组合,以及歌词韵脚,感觉都有可能。最后也证明我这部分记忆都是不准确的。

Notes on Color #9: Color Calibration

In January, as part of the preparation for digital painting training, I calibrated my laptop display and my pen display. Yet in April I realized that images look quite different on my laptop, on the pen display, on my phone or on others' devices. After hours of research, trail and error, I managed to learn more principles and calibrated my hardware and software. Here are some notes: 1. Colorimeters are not spectrometers. Instead of measuring the full (visible) spectrum, the main goal is to simulate a standard observer (with three color receptors), or XYZ values. 2. Due to #1, there are assumptions made here and there to cut down the cost without hurting the quality too much. However an important aspect is the type of monitor (e.g. WLED, WLED+phosphor, GB LED,  RGB LED, OLED etc.).  The chracteristics of each type is diffrent, mostly on the "base spectrum". The calibration may look off if the wrong correction matrix is used. Note that old colorimeters might not support new...

Notes on Color #8: Idealized Gamut Mask

Continuing with the previous post , in this one I'll try to identify the goal of gamut mapping, and to create an idealized model.  The Color "Wheel" A quick word with color wheel before we can proceed. The color wheel arranges all paint (or device) colors (or more accurately, chromacity) in a hue-chroma system. The modern version is the uniform color system (UCS). I'll use CAM16UCS as an example. Here is the full visible gamut under D65, projected into CAM16UCS. "top view" of the D65 visible gamut in CAM16UCS. The color at (0, 0) is white. The colors have been mapped to sRGB. "Side view" of the D65 visible gamut in CAM16UCS. Note the chroma is 0 at the topmost and the bottom-most. The colors have been mapped to sRGB. Observe that the top view resembles the the color wheel, but it is nothing like a perfect circle. We could say this is our modern version of the color "wheel", which presents chromacity uniformly on a 2d plane. I also include...

Notes on Color #7: Revisiting James Gurney's Gamut Mask

Gamut masks, or gamut mapping, is a color managing tool made popular by James Gurney . It is a set of practical instructions, which allows us to easily create a palette of harmonic colors. James has explained the method in various formats: 2008 blog post 2011 series 1 , 2 , 3 Video  on Youtube. His book Color and Light: A Guide for the Realist Painter I found this method so inspiring when I first learned about it around 2014. Recently it came back to my mind when I started developing the digital Zorn palette , which turned out to work quite well . I decided to revisit the cool method, in the hope of getting better understanding the method and some color therories. The goal includes: Recognizing the limitation of physical paints. Figuring out an idealized model of the method. Adapting the method for digtal painting. The Original Method I'd summarize the original gamut mapping method as the following 3 steps: Start with a color wheel. Maskthe color wheel with a simple shape, typicall...

Notes on Color #6: Creating a Zorn Palette

Update: the palette for Krita is available here . For beginners, limited palette is a useful tool for learning to use colors. Among many of those, the Zorn palette, used by Anders Zorn, seems popular in some ateliers. There are a few variations of the Zorn palette. The version that I'm learning consists of the following base colors: Ivory Black Permanent White or Titanium White Yellow Ochre Cadmium Red Light When painting, you are only allowed to obtain colors by mixing these base cases. Depsite of its simplicity, the palette is surprisingly powerful, especially for portrait painting. Since I'm learning both painting and color theories, I find it interesting to make a digital version. Mixing Paints The process of mixing paints is rather complicated . It is somewhere between additive-average and subtractive. However the situation is simple because the Black and White has very few chroma, and the Red and Yellow are very close in the color space. In this case we could get quite go...

Notes on Color #5: Projecting Munsell Colors

Before the digital era, the Munsell Color System  was probably the best perceptually uniform color system with hue, chroma and value components. It is also used nowadays. The 1943 Munsell renotations (with portion cut away). Source: Wikipedia   CC BY-SA 3.0 When reading the introduction page of Oklab , I learned about the idea of projecting Munsell colors into diffrent color space. I find it an intuitive and fun way to study color space. Who does not like colorful demos? Here we have to assume the quality of the Munsell data, which might not be 100% scientific. Anways I think it should be good enough, as proved by generations of aritist. With this assmption, we may examine munsell colors in the target color space, and observe the following: - Do the points with same chroma form a perfect circle? Are they distributed evenly? - Do the points with same hue form a straight line? Are they distributed evenly? - For luminance/brightness, actually I assume decient color spaces ar...

Notes on Color #4: HSY

Previously  I discussed why HSV and HSL are bad, despite that they are quite popular adopted by digital painting tools. I learnd about HSY from Krita, which seems to solve a number of issues. Here I did some quick explorations in order to learn more about it's properties. First of all, HSY is very similar to other HS* family members. The definition of H and S should be the same as in HSL. Y is for Luma, which is a weighted sum of (gamma-corrected) all three components. The weights reflect our brightness sensitivity of different wavelengths. The specific values depend on the actual primary colors. Here's a HSY disk at Y=0.5, for sRGB. HCY disk with Y=0.5 Comparing with HSV or HSL disk, this one looks smoother, and a bit "muddy" near the center. This means the Y value does predicts the actual luminance well. The gray version (converted via CIELAB) may verify this observation: L(CIELAB) channel of the HCY disk. So there is a huge improvement over other HS* models. It see...

Notes on Color #3: Color Spaces

The first time I heard of the term "color space" was probably from some article about display color gamut/calibration. I learned that it is important for a display to achieve at least 100% sRGB, for digital painting or image processing. Well I didn't know what exactly "s" means here, but I got a feeling that it has something to do with the RGB values in HTML color codes. A few color spaces Source: Wikipedia   CC BY-SA 3.0 The diagram could be very confusing. I had a few questions, which I think I can answer today: Why does it look like a weird 2d shape, instead of a 3d volume? It is a 2d shape, which is a slice of the 3d space at a constant luminance. More specifically, this is a sliced xy space at a specific value of Y. Why does the sRGB color space appear as a triangle? The sRGB color space is generated by 3 primary colors, which corresponds to the 3 vertices of the triangle. Moreover, for any 2 colors, all available colors obtained by mixing these 2 colors (w...

Notes on Color #2: What's wrong with HSV / HSL ?

Palette and Color pickers The word "palette" typically means a set of colors to choose from. In the digital world it means something similar, especially on older systems which support very small number of (e.g. 16, 256) colors. The first "advanced" color picker I saw was propably the color picker in Microsoft software, e.g. Paint, Word etc.  Color Picker in Microsoft Windows, which has not changed much since Windows 3.1.  At the time I was very excited by the colorful UI, and I had lots of fun exploring the colors. However, at that time I barely understood the numbers for red, green and blue, and by no means did I understood the other set of numbers: hue, sat and lum. Later I came across this "ring + triangle" or "ring + rectangle" color pickers, mostly in digital painting software.  HSV Color Picker in Krita At that time I didn't fully understand the differences of V, B or L, neither did I understand the differences between the rectangle ver...