Live data from Hacker News

Show HN: Trigrad, a novel image compression with interesting results

ruarai.github.io

31–40 of 69 posts

Re: Show HN: Trigrad, a novel image compression with interesting results

#31
post #25
post #21

Earlier quoted context omitted.

I'm missing where they are sorted by x-y values. I did a quick and dirty experiment: http://pastebin.com/NjZNRjw1 Seems about 30% smaller than before on http://i.imgur.com/5zwCEF5.png

Wow, that works pretty well. I was mistaken in thinking that either the Dictionary class or the process of sampling would sort them. Mind if I merge that? Or you could submit a pull request. Either would be great! Also, do you know of any resources for learning about how to optimise for gzip compression? Google is just telling me about compression for websites.

Sure, feel free to merge.

I don't know any resources specifically about gzip compression. Demosceners have very practical and fun compression know how, so maybe look into: http://www.farbrausch.com/~fg/seminars/workcompression.html

Re: Show HN: Trigrad, a novel image compression with interesting results

#32

How are the sample points selected? I get that they're weighted according to edge intensity, but what kind of distribution are you using in cases where there is no edge? EDIT: I've read the code - it seems to be using random sampling. Still not entirely sure how a point can be placed at a place with absolutely no Sobel response - maybe it can't, which would make sense. My question arose after looking at: https://i.im…

This is an area that needs work, but basically there's the table of 'edge intensity' that gets multiplied by a constant baseChance variable for every pixel.

baseChance = 8 * samples / (width * height)

samples is the desired number of samples.

Again, this needs work. I'm pretty sure there's a way I can more accurately match the number of output samples to the desired number of samples.

Edit: And no, it can't produce a response if there's no edge (a value of zero). However, there's always some level of noise. This is true of the example you've shown - there's very light noise visible.

Re: Show HN: Trigrad, a novel image compression with interesting results

#33

Very impressive! How might the final rendering look if it used some of the standard triangle shading techniques? Treat the sample points as coordinates in a mesh, assign colors to those coordinates based on what you sampled, then interpolate colors for the points between those coordinates using something like Gouraud or Phong shading (without the lighting). That might produce a satisfying result with fewer samples. I…

That's exactly what it does, no? (Standard triangle shading technique, interpolating colors between the mesh, Gouraud shading without the lighting.) Phong shading (interpolate normal vectors) wouldn't make sense, as the mesh has no normals.

Re: Show HN: Trigrad, a novel image compression with interesting results

#34
post #32

How are the sample points selected? I get that they're weighted according to edge intensity, but what kind of distribution are you using in cases where there is no edge? EDIT: I've read the code - it seems to be using random sampling. Still not entirely sure how a point can be placed at a place with absolutely no Sobel response - maybe it can't, which would make sense. My question arose after looking at: https://i.im…

This is an area that needs work, but basically there's the table of 'edge intensity' that gets multiplied by a constant baseChance variable for every pixel. baseChance = 8 * samples / (width * height) samples is the desired number of samples. Again, this needs work. I'm pretty sure there's a way I can more accurately match the number of output samples to the desired number of samples. Edit: And no, it can't produce a…

I see - thanks for the explanation!

Have you tried using Canny Edge detection rather than Sobel? It might help a bit with the noise. I've just attempted it, but can't seem to get Canny working under Mono (I've not got a windows machine at the moment).

Re: Show HN: Trigrad, a novel image compression with interesting results

#35

This is the difference between someone who actually does something and academic work that claims to achieve something. This is half-done, but it WORKS and you can use it and understand it right now. I had the opportunity to try and implement a "novel" algorithm for image downscaling. I contacted the authors - one replied that he can't reveal the source code, and the other didn't reply. So I went ahead and invested ab…

I mean the author no harm, nor want to talk bad about his work. His work is very cool and I like the amount of information that he gives. Yet, this is far from comparable to academic work. I am inclined to say that you mixed up the sides in your statement, IMHO.

Academic work would have explained the benefit of the algorithm. It would have presented it with a side by side comparison with common algorithms and explain it's pros and cons against these algorithms. It would have covered all aspects like quality, size, performance to name a few. It would have explained me if I could use this new algorithm in my field, and why (not). None of this is present in the current work shared here. You say this is half done, I would say this is not even 20% done..

To end on friendlier terms, I completely agree that more academic work should have been made available. Yet, I know the pressure in that world and can understand keeping it for yourself for a while. More often than not you will have to drag out a couple of other papers in the same field.

Re: Show HN: Trigrad, a novel image compression with interesting results

#36
post #33

Very impressive! How might the final rendering look if it used some of the standard triangle shading techniques? Treat the sample points as coordinates in a mesh, assign colors to those coordinates based on what you sampled, then interpolate colors for the points between those coordinates using something like Gouraud or Phong shading (without the lighting). That might produce a satisfying result with fewer samples. I…

That's exactly what it does, no? (Standard triangle shading technique, interpolating colors between the mesh, Gouraud shading without the lighting.) Phong shading (interpolate normal vectors) wouldn't make sense, as the mesh has no normals.

It isn't obvious from the article that the color interpolation used here matches Gouraud.

Re: Show HN: Trigrad, a novel image compression with interesting results

#37

This is the difference between someone who actually does something and academic work that claims to achieve something. This is half-done, but it WORKS and you can use it and understand it right now. I had the opportunity to try and implement a "novel" algorithm for image downscaling. I contacted the authors - one replied that he can't reveal the source code, and the other didn't reply. So I went ahead and invested ab…

the results were far from what we wanted

That could be the reason why they didn't want to release any source code.

Re: Show HN: Trigrad, a novel image compression with interesting results

#38
Nice pictures, but they should really have indicated the filesize for the 3000-sample version and given more details about this part:

the samples can be saved and zipped up

Depending on the algorithm the results could vary wildly - there could be some characteristic of the samples that make them encodable in a smaller/easily-compressible way.

It also reminds me of this:

http://codegolf.stackexchange.com/questions/50299/draw-an-im...

Post reply on HN