Live data from Hacker News

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

ruarai.github.io

51–60 of 69 posts

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

#51
post #39

Not sure exactly, but wouldn't these images theoretically scale up better than jpeg? i.e. Making a 600x800 image out of a moderately compressed 300x400 seems like these would potentially scale better than jpeg (for some types of images).

I think you'd just start to notice the fuzzy artifacts more in a larger image and need to have more and denser samples to make up for it.

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

#52

I have an improvement to this: Run the edge detection twice . That way you get better gradients along sharp edges. Single run: http://i.imgur.com/kusJDRo.png Double run: http://i.imgur.com/rHYSzpq.png To me, at least, the double looks better. Especially in the stems. Just add the following to FrequencyTable.cs, after line 18 (var edges = ...) detector = new SobelEdgeDetector(); edges = detector.Apply(edges);

The double run does look a lot better.

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

#53

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…

In my experience[1] code is available maybe half of the time, if you really search for it: checking the academic and personal pages of every author, and scouring the code of every framework mentioned. You're lucky when the code is in C or C++ using a framework nobody uses (e.g. MegaWave), but half of the time the code is in MATLAB. All uncommented, using single character variables and under some restrictive or just w…

Just applying the algorithm to each color channel separately leads to color fringing when they get out of sync.

Is this effect bad enough that it's still visible in other color spaces that use a luminance channel?

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

#54

Earlier quoted context omitted.

In my experience[1] code is available maybe half of the time, if you really search for it: checking the academic and personal pages of every author, and scouring the code of every framework mentioned. You're lucky when the code is in C or C++ using a framework nobody uses (e.g. MegaWave), but half of the time the code is in MATLAB. All uncommented, using single character variables and under some restrictive or just w…

Just applying the algorithm to each color channel separately leads to color fringing when they get out of sync. Is this effect bad enough that it's still visible in other color spaces that use a luminance channel?

I was working in YCbCr and I found it noticable. Compare the bottom-right tile in https://github.com/victorvde/jpeg2png/commit/64bf10789092ccf... with swipe. It's worst with green around the top of the left black line, but there's green and red fringing everywhere. And this is a normal use case.

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

#55
post #35

Earlier quoted context omitted.

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…

This is the traditional model of academic publishing that was driven by the limited communication and collaboration ability of the time. A study like the one you describe would be done by multiple co-authors (I don't think I've written an image processing paper that doesn't have at least three people as authors, all of whom actually contributed to the work one way or another.) Furthermore, the traditional paper would…

> What this model of publication does not (yet) have is a reputation mechanism, but it isn't clear it needs one, because you can see the results (and the code) for yourself. As such, I think the author has not only done something interesting in the image compression space, they are pointing the way on the future of scientific publication.

The original post is certainly interesting, but that doesn't mean it extends our knowledge of image processing. For example, see this 20 year old paper that proposes the idea:

https://www.cs.cmu.edu/~./garland/scape/scape.pdf

This is something peer review would pick up on... That said, I don't mean to discourage the author. It's a great idea and nicely presented!

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

#56
post #23

Earlier quoted context omitted.

To the OP: There are also several other tools for scattered data approximation/interpolation developed in the last few decades, both mesh-based and mesh-free. Linear interpolation using barycentric coordinates on a triangulation is fast (and might be the most practical method for this particular use case), but nowhere near as good a result as you can get via other methods. See e.g. http://scribblethink.org/Courses/Sc…

Not sure if that applies for my purposes, since I'm not actually using linear interpolation barycentric coordinates (I don't think that's possible). The barycentric coordinates supply the gradient within themselves. I may have to read further, though. That's a lot of math.

What you’re calling a gradient is also known as linear interpolation.

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

#57

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…

Phong is a lighting model.

What you are talking about is barycentric interpolation, which is what this is doing.

There are already image resizing algorithms that use triangulation (and something called DDE - data dependent interpolation) so the answer to your question is yes it is absolutely a valid idea.

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

#58
This is neat and the illustrations are great. A few things that will probably give large gains while being low hanging fruit:

1. There are triangle interpolation schemes out there now that are smoother than barycentric coordinates which should give much better results.

2. Look up DDE - Data dependent triangulation. It switches edges to connect points to neighbors that have similar values. It will get rid of some of the spikiness and leave more smooth gradients.

3. The running the edge detection twice scheme mentioned in the comments works because you want the change of the gradient, and you need both sides represented. So the double edge detection will give you manifolds, which is good.

4. Instead of having arbitrary vertex positions, you can just specify the offset to the next point. Then instead of an x and y value you can use one (possibly uint8_t) value to encode where the next point will go.

5. You can also chop some accuracy off of colors. In RGB, you can lose accuracy in blue and some in red. In other schemes like you can keep accuracy in luminance and lose it heavily in hue and chroma/saturation, etc.

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

#59

This is neat and the illustrations are great. A few things that will probably give large gains while being low hanging fruit: 1. There are triangle interpolation schemes out there now that are smoother than barycentric coordinates which should give much better results. 2. Look up DDE - Data dependent triangulation. It switches edges to connect points to neighbors that have similar values. It will get rid of some of t…

W.r.t. running the edge detection twice. Is there a name for this operation? Finding points that are near an edge but not on the edge?

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

#60

This is neat and the illustrations are great. A few things that will probably give large gains while being low hanging fruit: 1. There are triangle interpolation schemes out there now that are smoother than barycentric coordinates which should give much better results. 2. Look up DDE - Data dependent triangulation. It switches edges to connect points to neighbors that have similar values. It will get rid of some of t…

W.r.t. running the edge detection twice. Is there a name for this operation? Finding points that are near an edge but not on the edge?

The Laplacian.
Post reply on HN