4 ms·
I did it in PDF by manually writing a custom tint transformation function. I used a 16x16 image with grayscale values from 0 to 255 and split the values in nibb
by poizan42 11y ago
I did it in PDF by manually writing a custom tint transformation function. I used a 16x16 image with grayscale values from 0 to 255 and split the values in nibbles in the function code (which is a limited subset of postscript without things such as control flow). This worked fine, though a 16x16 Mandelbrot isn't very interesting.
So I tried with a 256x256 image instead with 16bpp, but it turns out that most viewers doesn't give a fuck and rounds the values down to 8 bits of precision before they are handed to the tint function.
- leni536 11y agoNice experiment. Some time ago I bumped into a similar problem when I experimented with SVGs lighting functions. SVG supports Phong shading based on a bump map. AFAIK you have to pass the bump map as the alpha channel of an image. Firefox only uses 8 bits for the alpha channel so the sphere I designed had steps on it. Also Firefox used the sRGB non-linear colorspace for Phong shading producing incorrect results, but it was a different annoyance.
- poizan42 11y agoI just found my experiments. Code for the 16x16 Mandelbrot here: https://gist.github.com/poizan42/71f38038e8d91f91f8b8 https://gist.github.com/poizan42/71f38038e8d91f91f8b8 Experimentation with creating 256x256 Mandelbrot here: https://gist.github.com/poizan42/3054232ad7624602a7fa https://gist.github.com/poizan42/3054232ad7624602a7fa
- leni536 11y agoMy sphere experiment: https://jsfiddle.net/qb3pjojv/ https://jsfiddle.net/qb3pjojv/ Apparently Chromium has the same problem as Firefox, however the image doesn't look like the same in the two browsers. The Firefox version is much darker mostly because of the usage of the incorrect colorspace for shading.