Lasse D

Let's revolutionize mosaic software!

Recommended Posts

I am creating my own LEGO mosaic software, but development has sadly been dormant for a couple of years. I want to make a program that is better than all others out there, and I think the key to success is through nearly instant preview of the final mosaic when you change settings, and through superior algorithms (methods) for computing the mosaics.

So far I have tried to achieve this by using Floyd-Steinberg's algorithm for dithering, while allowing the user to change hue, saturation, brightness, gamma and other controls before applying the dithering algorithm.

Here is a screenshot:

cola_flat.png

Santa

In order to stretch the limits on how good pictures I could generate, I decided to use the program to make a mosaic of Santa drinking for the side of my coke truck. This is a challenge because of the small size of the picture.

This was the best mosaic I could come up with this way:

1deco2.jpg

Let's take a closer look:

santa_0.jpg

Sure you can kinda make out that it is Santa drinking a coke, and I did use this on my truck. But it isn't really good enough IMO.

See if you can find it among the originals:

santaproposals.png

Better Santa

I am sure this can be done better, so I used the picture from above and found the color regions which should be separated. This was done manually:

santa_1.jpg

When I had the color regions, I could go on and add depth by adding different colors, This is very much like how the mosaic software applies dithering. This is the result:

1side1.jpg

(This is only a minor change in the trailer, so it will not have a separate topic)

It i now much easier to see what the picture depicts. What I want to do now is to make this manual process automatic, and a part of how the program makes mosaics.

But before I go on, I have to formalize what I did, and I want to ask the community: Do you agree with me that this way of making a mosaic is better than the original? And do you have any other ideas of how to improve mosaic software?

Share this post


Link to post
Share on other sites

[quote name='Lasse D' date='05 May 2011 - 01:36 PM' timestamp='1304617016' post='982428'}

It i now much easier to see what the picture depicts. What I want to do now is to make this manual process automatic, and a part of how the program makes mosaics.

But before I go on, I have to formalize what I did, and I want to ask the community: Do you agree with me that this way of making a mosaic is better than the original? And do you have any other ideas of how to improve mosaic software?

Wow. I am very impressed with your results. Great job.

This is probably a stupid question, but can you change the orientation of the bricks that comprise the mosaic? For example, you're images show a 1x1 plate stud up. Can it be switched to a simple 1x1 stud out layout?

Share this post


Link to post
Share on other sites

Have you tried the PicToBrick mosaic software?

Yeah, and I am using it for a project. but the problem with pictobrick is that is doesn't update dynamically, and, MUCH worse, it doesnt allow you to go back and change the previous settings (for example, once you've chosen the size you want the mosaic to be, and then go and choose all the options, and click apply, then you have a picture with not enough definition, you have to start a whole new mosaic if you want to change the size)

Share this post


Link to post
Share on other sites

Wow. I am very impressed with your results. Great job.

This is probably a stupid question, but can you change the orientation of the bricks that comprise the mosaic? For example, you're images show a 1x1 plate stud up. Can it be switched to a simple 1x1 stud out layout?

Thanks. Yes. That is what the button with the plate seen from the side is for. It can also build using SNOT techniques.

Have you tried the PicToBrick mosaic software?

My main competitor. This is what I'm trying to beat. Everyone in my lug prefers this software, and the guys who made it are great guys, but I want to see if we can do better.

Yeah, and I am using it for a project. but the problem with pictobrick is that is doesn't update dynamically, and, MUCH worse, it doesnt allow you to go back and change the previous settings (for example, once you've chosen the size you want the mosaic to be, and then go and choose all the options, and click apply, then you have a picture with not enough definition, you have to start a whole new mosaic if you want to change the size)

All these problems are not present in my software, but they also have a key feature I don't have yet: Printing.

Share this post


Link to post
Share on other sites

I like that you've got the official LEGO color names for this. That will certainly make it easier to order the parts you need off of Pick-A-Brick. And it looks like the program also allows you to select which colors you use, which makes it a lot easier to limit yourself to PaB parts or parts from your own collection if you so chose.

Nevertheless, I'm sure there are some people who would rather use Bricklink color names, especially for older, more obscure colors that they're not likely to find in huge quantities in their own collections or able to order from PaB. Perhaps if you had an option to switch between different naming systems (TLG/Bricklink/Peeron)? For all I know, you might already have this, but I'm just throwing that receommendation out there.

The problem with that idea would be that certain Bricklink colors correspond to more than one LEGO color (I'm sure the same problem exists with Peeron and other databases, of course). Thankfully, this mostly applies to metallic colors which people aren't likely to be using in mosaics (and most of which don't exist as 1x1 plates even). But nevertheless, know in advance that a 1:1 color conversion table isn't going to be totally reliable for this sort of thing as long as there are colors like 221 Bright Purple and 22 Medium Reddish Violet (both of which Bricklink identifies as Dark Pink).

Overall, though, I'm very impressed with your ambitions for this software, and I hope you continue to find solutions for the problems that remain!

Share this post


Link to post
Share on other sites

The program works with unique color identifiers internally, and I will make sure you can choose whose naming you prefer in the settings. The program downloads the Peeron color list and uses it to connect all the colors.

But this is all minor stuff that is easy to do compared to an algorithm that is really good at drawing.

I'm also looking into different ways of substituting colors in the pixels in order to have less noise... and I'm open for all ideas.

Share this post


Link to post
Share on other sites

That's a great example of the other thing I want to improve upon: Artifacts. Look at the red spots on her nose, which come from the dithering algorithm trying to compensate for a 'lack of red'. Unfortunately it's over-compensating visually by doing this. I want to create an algorithm that is more gentle when trying to find colors (or pigmentation) to compensate.

Share this post


Link to post
Share on other sites

Yes. He claims to use Floyd-Steinberg as well. He also appears to have some aversion fro gray bricks.

Do you see any ideas or problems from his project worth pointed out?

Share this post


Link to post
Share on other sites

This might just be throwing a spanner into the works, but I think that automating the process that mahjqa describes here would blow the competition out of the water.

Share this post


Link to post
Share on other sites

Some examples of said mosaics:

3821998502_8f8b563bf0_m.jpg

3697670074_6fc456e05d_m.jpg

4764858914_bffed8873a_m.jpg

However, even though the computer does most of the grunt work, all of these have had a lot of manual tweaking before they're good enough. I hope your program supports some kind of editing after the software has had a go at it.

Edited by mahjqa

Share this post


Link to post
Share on other sites

Yes. My program can do that too, hence the Coke logo in OP.

You can save in .ldr or a variety of bitmap formats if you want to do post editing. I'm looking for better algorithms, so there should be as little post editing as possible.

Share this post


Link to post
Share on other sites

At some point better algorithms won't help anymore. The human eye and brain have got millions of years of evolution, and there's simply no software that will replicate it anytime soon.

If you'd compare the mosaics I make, and the pictures they're made from, you'd see that they're not completely accurate. I've exaggerated edges, lines and fine details so they'd stand out, or completely rework eyes and hands so they work better given the limitations of the bricks.

Any idea if you'll include mosaics with multiple orientations?

Share this post


Link to post
Share on other sites

At some point better algorithms won't help anymore. The human eye and brain have got millions of years of evolution, and there's simply no software that will replicate it anytime soon.

If you'd compare the mosaics I make, and the pictures they're made from, you'd see that they're not completely accurate. I've exaggerated edges, lines and fine details so they'd stand out, or completely rework eyes and hands so they work better given the limitations of the bricks.

Any idea if you'll include mosaics with multiple orientations?

You are probably right, but I don't think algorithms are good enough to say that they can't be improved further.

This exaggeration of detail that you do, could perhaps be done automatically to some extend if we can identify the important features. I have seen a presentation where they have done something similarly when editing pictures for different aspect ratios in Disney films.

And I already have the multiple direction feature in the software, hence the coke logo in OP.

Edited by Lasse D

Share this post


Link to post
Share on other sites

You are probably right, but I don't think algorithms are good enough to say that they can't be improved further.

This exaggeration of detail that you do, could perhaps be done automatically to some extend if we can identify the important features. I have seen a presentation where they have done something similarly when editing pictures for different aspect ratios in Disney films.

And I already have the multiple direction feature in the software, hence the coke logo in OP.

Hmm...perhaps at the beginning of a mosaic, you could ask the user for the "type" of image, so your program would exagerate black lines if they chose "cartoon," or something along those lines.

Share this post


Link to post
Share on other sites

That is a good place to start. When I get the time, I can try to do this and see what I can learn from that. Perhaps the general case isn't as hard to figure out as it might seem.

Share this post


Link to post
Share on other sites

I just found a program to make lego mosaics called "Bricksaic".

It can be found HERE.

I never tried it myself, but it looks good.

Maybe you can get some inspiration of it? :classic:

Share this post


Link to post
Share on other sites

A feature I'd love would be to create a lxf or ldr file, so that I could have my "virtual" mosaic in 3D.

Share this post


Link to post
Share on other sites

A feature I'd love would be to create a lxf or ldr file, so that I could have my "virtual" mosaic in 3D.

The program I posted above can do that (a ldr file) :classic:

Edited by legolijntje

Share this post


Link to post
Share on other sites

Is there digital mosaic software that can model 1x1 round plates centered on 2x2 round plates? Behold this BIG Lego mosaic of actress Halle Barry (photographed at the TwinLUG table at SpringCon 2011, and posted on Garth Danielson's Flickr photostream):

5759704461_09abd53f64_o.jpg

Share this post


Link to post
Share on other sites

The program I posted above can do that (a ldr file) :classic:

It seem like it's just using Floyd-Steinberg like all the other programs. See the posts in this thread.

And outputting .ldr files is easy, other programs, such as the one in OP can do that too.

>DLuders

I think you should ask Garth Danielson's. Doing a mosaic this way gives you only 20% of the resolution that a plates-from-the-side would give.

Share this post


Link to post
Share on other sites

It seem like it's just using Floyd-Steinberg like all the other programs. See the posts in this thread.

And outputting .ldr files is easy, other programs, such as the one in OP can do that too.

It has more options for dithering:

-Floyd Steinberg

-Stucki

-Sierra

-Jarvis, Judice & Ninke

-Stevenson & Arche

-Burkes

-Nearest color

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.