News for hackers. Stuff that matters.
Re:3D scatterplot of an image by rijoja on Friday December 15, 2017 @07:45AM (#15931358)
Would it be possible to make a human recognizable 3D-object in the colorspace that also is a pretty picture in 2D?
Re:3D scatterplot of an image by crispyambulance on Friday December 15, 2017 @09:32AM (#15932044)
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 by rijoja on Monday December 18, 2017 @08:31AM (#15951451)
Yes yes fourier transforms is what make mathematicians go mad and or religious.
Re:3D scatterplot of an image by seanlinehan on Friday December 15, 2017 @11:59AM (#15933152)
Do you have any examples of this? Sounds cool
Re:3D scatterplot of an image by yorwba on Friday December 15, 2017 @01:41PM (#15933987)
I did a Jupyter notebook http://nbviewer.jupyter.org/github/Yorwba/image_frequency_sc...

I should have probably written more comments, but I really need to go sleep now.

Re:3D scatterplot of an image by crispyambulance on Friday December 15, 2017 @03:55PM (#15935014)
Yep, that's it! Here's the same thing in R...

  library(imager)
  download.file("https://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png",'lena.png', mode = 'wb')
  
  lena <- load.image("./lena.png")
  plot(lena)
  
  lena_fft <- FFT(lena)
  lena_pwr <- sqrt( lena_fft$real^2 + lena_fft$imag^2)
  lena_ph  <- atan2(lena_fft$imag, lena_fft$real)
  
  lena_ph[1:512,1:512,1,] <-  matrix(runif(512*512,-pi,pi),ncol=512) 
 
  lena_mess <- FFT(lena_pwr*cos(lena_ph),lena_pwr*sin(lena_ph),inverse = TRUE)
  
  plot(sqrt(lena_mess$real^2 + lena_mess$imag^2))
Re:3D scatterplot of an image by GistNoesis on Friday December 15, 2017 @10:55AM (#15932641)
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.
Re:3D scatterplot of an image by rijoja on Monday December 18, 2017 @08:40AM (#15951492)
It just struck me that the resolution of the image can be modified, if more or less voxels are needed!

Let's say if we have a 4096 times 4096 image we can reach and fill all values in the 3d representation, if we want to!

Re:3D scatterplot of an image by Confiks on Friday December 15, 2017 @08:21AM (#15931579)
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 the four color spaces that is also a pretty picture in 2D?

Re:3D scatterplot of an image by rijoja on Monday December 18, 2017 @08:27AM (#15951424)
Clever to start out with a greyscale image! But it still poses some constraints, let's say if we start with an all black image for an edge case to demonstrate the limitations, we can only have a 2D pattern in the 3D space, right?

However the luminance component of the image could probably be adjusted within certain error margins and vice versa. Perhaps by some form of bruteforce!

To know for sure I suppose coding is needed!

Re:3D scatterplot of an image by enriquto on Friday December 15, 2017 @09:33AM (#15932055)
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 by 0xdeadbeefbabe on Friday December 15, 2017 @12:24PM (#15933352)
Sounds like a good art project.
Re:3D scatterplot of an image by vuknje on Friday December 15, 2017 @02:02PM (#15934148)
You mean something like this? https://youtu.be/YaA3dAJz6sI?t=45s
Re:3D scatterplot of an image by 05greg on Friday December 15, 2017 @08:23AM (#15931588)
Yeah, the points in the 3D colourspace have no mapping to a 2D location on an image, you could create one that gives a pretty image if you wanted.