News for hackers. Stuff that matters.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by dontreact on Thursday November 10, 2016 @01:40PM (#12922979)
Shameless plug/relevant background: I did this in order to make a flyer for a show I am playing with my band Congratulatinos in Oakland, CA on Dec. 17th Band: http://congratulatinos.bandcamp.com/ Event: https://www.facebook.com/events/661571907356009/
Re:Show HN: Reorganize pixels of a painting into a smooth co... by pavel_lishin on Thursday November 10, 2016 @01:50PM (#12923065)
I opened a small PR - scipy was missing as a requirement (I'm guessing you already had it installed, and didn't stick it in requirements.txt)
Re:Show HN: Reorganize pixels of a painting into a smooth co... by dontreact on Thursday November 10, 2016 @01:51PM (#12923072)
thanks. right on all counts.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by rand_r on Thursday November 10, 2016 @01:53PM (#12923094)
This looks interesting. I was wondering if you could explain a little more about what information about a picture this transform is exposing? I mean, if you look at just the output image, what kind of insight can you gain into the original input image?
Re:Show HN: Reorganize pixels of a painting into a smooth co... by dontreact on Thursday November 10, 2016 @01:54PM (#12923101)
For some paintings I think you can get a sense of what paints the painter used.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by ecesena on Thursday November 10, 2016 @01:50PM (#12923061)
Just to clarify: you started with the pic of the 2 guys and created the fading effect used to color the writing with pca?

That's pretty awesome, I think the final effect is very pleasant to the eyes.

Re:Show HN: Reorganize pixels of a painting into a smooth co... by dontreact on Thursday November 10, 2016 @01:53PM (#12923096)
The script merely remaps the pixels in the input to new locations via PCA. I'm not 100% sure I know what you mean by "2 guys" or "color the writing".
Re:Show HN: Reorganize pixels of a painting into a smooth co... by btym on Thursday November 10, 2016 @01:57PM (#12923123)
The two guys on the page you just linked. The colored writing on the page you just linked.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by dontreact on Thursday November 10, 2016 @01:59PM (#12923139)
Huh still confused somehow, sorry. This is the input https://github.com/ardila/paintingReorganize/blob/master/inp...

My script moves the pixels of that image around to get this output https://github.com/ardila/paintingReorganize/blob/master/out...

Re:Show HN: Reorganize pixels of a painting into a smooth co... by minimaxir on Thursday November 10, 2016 @02:02PM (#12923170)
They are asking how the generated gradient from the script was incorporated into the final image of the band promo.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by dontreact on Thursday November 10, 2016 @02:31PM (#12923447)
The flyer is in the facebook event not the band page. The cover photo for the album was a completely separate project :)
Re:Show HN: Reorganize pixels of a painting into a smooth co... by dontreact on Thursday November 10, 2016 @02:11PM (#12923258)
Ahhh. I tiled the image 4 times, remapped to polar coordinates, then did some color balancing.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by wodenokoto on Friday November 11, 2016 @05:14AM (#12929378)
Did you also experiment with a simple sorting algorithm and if so, how were the results different?
Re:Show HN: Reorganize pixels of a painting into a smooth co... by pavel_lishin on Thursday November 10, 2016 @02:04PM (#12923188)
I think there's a bug in there that flipped a few columns - but I actually really like the output better that way: http://imgur.com/RErXOF6
Re:Show HN: Reorganize pixels of a painting into a smooth co... by dontreact on Thursday November 10, 2016 @02:10PM (#12923237)
That is weird. It decides to flip a column by summing up the vector distances between the pixels in that column vs. the pixels in the previous column. I'm wondering if that since there is so much gray in the painting, this causes a large accumulation of error in gray vs. slightly different gray which outweighs the orange vs gray.

I do know that euclidean distance in RGB space is not that great a metric for perceptual similarity. Perhaps everything should be done in YUV instead? I will try tonight. Thanks.

Re:Show HN: Reorganize pixels of a painting into a smooth co... by iverjo on Thursday November 10, 2016 @02:24PM (#12923373)
I recommend you to try the LAB color space and to use delta E 94 [1] for computing distances between colors in the color space

[1] https://en.wikipedia.org/wiki/Color_difference#CIE94

Re:Show HN: Reorganize pixels of a painting into a smooth co... by xbryanx on Thursday November 10, 2016 @01:58PM (#12923134)
The colors in that image seem super bright compared to the original.

https://www.moma.org/collection/works/79971?locale=en

Re:Show HN: Reorganize pixels of a painting into a smooth co... by dontreact on Thursday November 10, 2016 @02:03PM (#12923187)
The output for that version of the painting looks similar. I just image searched for "kupka" and tried a few different results.

Result for your image: http://imgur.com/fp9i8BP

Do you think I should update the repo with this version?

Re:Show HN: Reorganize pixels of a painting into a smooth co... by xbryanx on Friday November 11, 2016 @11:22AM (#12932031)
I do, only because it's from the institution that actually owns the real painting. Museums try pretty hard to get colors right on the digital images that they put online. And since the project is about color, it seems like an important detail. Thanks for being open to my nitpicking. Very cool project.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by tomek_zemla on Thursday November 10, 2016 @06:18PM (#12925575)
Made somewhat similar project by organizing pixels in three dimensional space of HSL (hue saturation lightness) color model: http://www.pixelbox.com/colorclouds/

Note that this reduces identical pixels into one point in 3D space. The key idea behind the experiment was to learn more about the palettes used by painters.

Re:Show HN: Reorganize pixels of a painting into a smooth co... by binarymax on Thursday November 10, 2016 @03:22PM (#12923954)
I love pixel sorting! I had seen it done by rows or cols before, but never the whole thing, and the result is beautiful.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by teaearlgraycold on Thursday November 10, 2016 @02:11PM (#12923249)
I'm curious where the noise is coming from, as some pixels appear to be out of place.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by dontreact on Thursday November 10, 2016 @02:17PM (#12923309)
Yes: it seems to be for colors where they are similar to two or more other clusters of pixels. I imagine that these are just really hard to place without seeming too out of place? Also probably has to do with the column by column "greedy" approach that isn't really global.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by Kenji on Thursday November 10, 2016 @03:17PM (#12923891)
Probably some form of dithering, I'd guess. I'm curious myself.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by throwaway049 on Thursday November 10, 2016 @05:31PM (#12925139)
In one Iain M Banks story, it is mentioned that a character was ordered not to destroy a library, so he had all the paintings given the treatment provided by this software and all the books cut up and arranged so that individual letters were in alphabetical order.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by pbhjpbhj on Thursday November 10, 2016 @03:18PM (#12923906)
My first thought was "paintings don't have pixels"; but colour is quantised I guess. I wonder how many pixels you need to get the same graduation between color tones as the original image, presumably enough to provide atom level resolution.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by mistercow on Thursday November 10, 2016 @05:43PM (#12925253)
I believe the term you want is "discretized", not "quantized". They're quantized too, but that's about there being a finite number of shades rather than a finite number of subdivisions of the image.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by dweinus on Thursday November 10, 2016 @11:34PM (#12927870)
As a graphic designer turned data scientist, that is the coolest poster art backstory I have ever heard.
Re:Show HN: Reorganize pixels of a painting into a smooth co... by Houshalter on Thursday November 10, 2016 @05:45PM (#12925270)
Are there any more examples?
Re:Show HN: Reorganize pixels of a painting into a smooth co... by dontreact on Thursday November 10, 2016 @07:52PM (#12926358)
I just put up 3 more. Starry night turned out very nicely. Anything you'd like to see in particular?