

--
Has recibido este mensaje porque estás suscrito al grupo "FPGAwars: explorando el lado libre" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a fpga-wars-explorando-el...@googlegroups.com.
Para ver este debate, visita https://groups.google.com/d/msgid/fpga-wars-explorando-el-lado-libre/75ddaf07-cf45-4b56-9bf9-98ee46810f8en%40googlegroups.com.
--
Has recibido este mensaje porque estás suscrito al grupo "FPGAwars: explorando el lado libre" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a fpga-wars-explorando-el...@googlegroups.com.
Good night guys.
Hey Joaquim! Speaking of hamsters, I’ve jumped on your wheel — I found a potential use for the calculator beyond just checking the color palette.
Your dithering exercise is great, but for low-resource situations (computational limits, memory, FPGA pins, etc.), it doesn’t really help us much.
What I mean is, for example, with your image — if I quantize it to 64 colors like you did, even without using dithering it already looks pretty decent:

We can zoom in and look at the pixelation details caused by the quantization, but as we can see, it’s quite “readable” or easy to visualize.

In short, we look for the most frequent colors and then find the closest match, like you did with k-means or similar algorithms, narrowing it down to a palette of just 64 colors, resulting in something like this:

That would be great if we could actually choose those colors to draw, for example, on the VGA with the Alhambra. But the reality is that on the Alhambra we only have these colors (obtained with the calculator and the resistor configuration from Jesús’s board):

If we loaded the image into the FPGA and displayed it, we’d see this (the same image as above, quantized to 64 colors):

Zooming in, we can see the colors it actually uses, since our real display palette has nothing to do with the original image:

I’m sure anyone who’s played with VGA on the Alhambra at 2 bits per pixel and tried to render an image has run into something like this.
If we implemented a similarity-based color remapping system—working in Lab color space and doing thousands of floating-point operations—we could make the image look this good on the Alhambra with our palette. That could be pretty interesting, but on these small FPGAs it only really makes sense to do it offline and use images already prepped for our palette:

In the close-up, we can see that the algorithm blends colors to create similar visual impressions when viewed from a distance:

The problem is that doing this in real time is not feasible on our small FPGAs, but—as I said—it’s very appealing if what you need is to show a few fixed images or sprites that you can precompute beforehand.
With that in mind, it occurred to me that we could use a couple of algorithms very close to the three-color printing process, and they’d be implementable on our FPGA in real time. I kept running some proof-of-concept tests and, starting from your original image (the raw one, with no conversions), rendered on the VGA with our palette it would look like this (Bayer 8×8):


…and here’s another one—slightly lower quality, but it should use far fewer resources (2×2 superpixels):

At some point I’ll implement this on the FPGA—it seems interesting and useful, and it lines up with a few ideas I’ve had. But if anyone wants to take a crack at it in the meantime… ;) If you’re interested in the code, let me know and I’ll share it. I threw it together quickly just to test the concept and it’s not presentable right now, but if there’s interest I’ll clean it up properly.
As for the calculator, it might be nice to export palettes to CSV or some other script-friendly format (I exported from the browser console, and it made me think a handy “button” would be useful), and maybe even include some of these algorithms to convert images based on the palettes. What do you think?
Thanks a lot, Joaquim! With everyone’s input, really cool things come out.
Good night!






