Live data from Hacker News

3D scatterplot of an image

alexander.engineering

31–40 of 78 posts

Re: 3D scatterplot of an image

#31
post #2

Would it be possible to make a human recognizable 3D-object in the colorspace that also is a pretty picture in 2D?

Well, there's another neat thing that you can do if you want to generate an interesting 2D -> 2D representation:

* Take fourier transform of the image for each color R, G, B

* Randomly scramble the phase of the transformed image.

* Perform the fourier inverse of that scrambled phase image.

The result is another 2D image with the same colors AND spatial frequencies as the original image. It looks like you took the original photo and vaporized it into gas. Interesting.

Re: 3D scatterplot of an image

#32
post #12
post #2

Would it be possible to make a human recognizable 3D-object in the colorspace that also is a pretty picture in 2D?

The answer is quite obvious. You could start off with a grayscale 2D image on one side, and a pretty dotted 3D object on the other side. You'd then read the coordinates of the 3D object in a specific color space to obtain color values which you can pretty randomly (or even judiciously) apply to the grayscale image. Now I would pose another question: would it be possible to make a human-recognizable 3D-object in all t…

the transformations between color spaces are smooth maps, so each of the 3D objects would be the same thing (with some warping and stretching)

Re: 3D scatterplot of an image

#33
Sounds cool, I will check it out on a laptop.

Just in case the author is here, I tried on an iPad Pro, and got "WebGL is not supported by your browser". WebGL is in fact supported by mobile Safari, so I'm guessing this site is using a user agent whitelist or some other fallible method of detecting WebGL. The best way to detect WebGL support is to attempt to create the 3d context and wait until after it actually fails. That, or simply do not check for WebGL failure; the browsers all handle it anyway.

Re: 3D scatterplot of an image

#34
post #20

This is really cool! I'm a painter and have spent a long time doing gamut analysis of paintings. Thank you for including both HSV and HSL. Not enough people appear to understand/care about the difference between the two, and for painters the distinction is everything .

Why is the distinction important for painters?

I'd guess it's because mixing colors in paint is subtractive—if you mix every color you get black. Whereas with light, mixing colors is additive—if you mix every color you get white. In HSL, fully saturated colors have .5 brightness, and adding white or black changes the brightness but not the saturation. My guess is that works more similarly to paint than HSV does.

Re: 3D scatterplot of an image

#37

Earlier quoted context omitted.

Hmm, I guess someone would have thought of that, but this could probably be used for compressing images by reorienting the color axes so that one of them is perpendicular to this color plane, and then sending less information about that coordinate.

Yeah, you can use principle component analysis to figure out the transform to make the colour space "optimal" for compression of a specific image. I tried that once: https://bainbridgecode.wordpress.com/2012/04/24/beating-png-... and https://bainbridgecode.wordpress.com/2012/05/07/beating-png-... There are plots at the end of part 3 showing the image channels separately for YCrCb and my custom PCA derived space. They…

Finding the first primary component also appears to be a pretty good way greyscale an image.

Re: 3D scatterplot of an image

#38
post #33

Sounds cool, I will check it out on a laptop. Just in case the author is here, I tried on an iPad Pro, and got "WebGL is not supported by your browser". WebGL is in fact supported by mobile Safari, so I'm guessing this site is using a user agent whitelist or some other fallible method of detecting WebGL. The best way to detect WebGL support is to attempt to create the 3d context and wait until after it actually fails…

Website works on iOS without any problem.

Re: 3D scatterplot of an image

#40
post #2

Would it be possible to make a human recognizable 3D-object in the colorspace that also is a pretty picture in 2D?

Yes, another way : take a colored picture, sample as many points as there are pixels on the surface of the 3D-object, then for each pixel of your picture pick without replacement its closest remaining color in your 3d object 'color palette'. The looping order still grants some artistic liberties.
Post reply on HN