Jump to content


Let's revolutionize mosaic software!


  • Please log in to reply
52 replies to this topic

#1 Lasse D

Lasse D

  • Pink Poodle


    Posts: 974
    Joined: 24-December 06
    Member: 1144
    Country: Denmark

Posted 05 May 2011 - 06:36 PM

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:
Posted Image

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:
Posted Image

Let's take a closer look:
Posted Image

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:
Posted Image


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:
Posted Image

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:
Posted Image
(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?
Posted Image Posted Image Posted Image
Posted Image Posted Image Posted Image

#2 kibosh

kibosh

    Posts: 661
    Joined: 03-May 11
    Member: 17620

Posted 05 May 2011 - 07:30 PM

[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?
[/quote]

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?
Check out my LEGO blog at All About The Bricks!

#3 DLuders

DLuders

  • Technic Technician


    Posts: 5817
    Joined: 17-October 09
    Member: 7868
    Country: USA (WA State)

Posted 05 May 2011 - 07:46 PM

Have you tried the PicToBrick mosaic software?

Posted Image

#4 Matanuilover

Matanuilover

    Posts: 34
    Joined: 15-January 11
    Member: 15441

Posted 05 May 2011 - 08:11 PM

View PostDLuders, on 05 May 2011 - 07:46 PM, said:

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)
If "guns don't kill minifigs, minifigs kill minifigs," does that mean that toasters don't toast toast, TOAST TOASTS TOAST?

#5 hga09

hga09

    Posts: 68
    Joined: 05-March 10
    Member: 9812

Posted 05 May 2011 - 09:43 PM

Especially if you are working at very low resolution (e.g. few tens of studs in each direction) it may be a good idea to pre-process the image to "cartoonify" it before converting it to mosaic.

http://www.photoshop...ng-tutorial.php

#6 Lasse D

Lasse D

  • Pink Poodle


    Posts: 974
    Joined: 24-December 06
    Member: 1144
    Country: Denmark

Posted 05 May 2011 - 09:47 PM

View Postkibosh, on 05 May 2011 - 07:30 PM, said:

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.

View PostDLuders, on 05 May 2011 - 07:46 PM, said:

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.

View PostMatanuilover, on 05 May 2011 - 08:11 PM, said:

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.
Posted Image Posted Image Posted Image
Posted Image Posted Image Posted Image

#7 Aanchir

Aanchir

  • Color Encyclopedia


    Posts: 8714
    Joined: 31-December 09
    Member: 8841
    Country: United States

Posted 05 May 2011 - 11:45 PM

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!

#8 Lasse D

Lasse D

  • Pink Poodle


    Posts: 974
    Joined: 24-December 06
    Member: 1144
    Country: Denmark

Posted 06 May 2011 - 12:55 AM

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.
Posted Image Posted Image Posted Image
Posted Image Posted Image Posted Image

#9 DLuders

DLuders

  • Technic Technician


    Posts: 5817
    Joined: 17-October 09
    Member: 7868
    Country: USA (WA State)

Posted 07 May 2011 - 05:31 PM

If you need some motivation, see   this Brickshelf gallery of this atrractive :wub: mosaic "96 studs wide and 320 plates high making it 32000 pieces total."   :sweet:

#10 Lasse D

Lasse D

  • Pink Poodle


    Posts: 974
    Joined: 24-December 06
    Member: 1144
    Country: Denmark

Posted 08 May 2011 - 04:26 PM

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.
Posted Image Posted Image Posted Image
Posted Image Posted Image Posted Image

#11 DLuders

DLuders

  • Technic Technician


    Posts: 5817
    Joined: 17-October 09
    Member: 7868
    Country: USA (WA State)

Posted 11 May 2011 - 01:54 PM

@ Lasse D:  Have you seen Maarten Steurbaut's Mosaic Conversion Program?  

Posted Image

#12 Lasse D

Lasse D

  • Pink Poodle


    Posts: 974
    Joined: 24-December 06
    Member: 1144
    Country: Denmark

Posted 11 May 2011 - 05:03 PM

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?
Posted Image Posted Image Posted Image
Posted Image Posted Image Posted Image

#13 VMLN8R

VMLN8R

    Posts: 495
    Joined: 13-August 09
    Member: 7017
    Country: Denmark

Posted 14 May 2011 - 08:56 AM

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.

#14 mahjqa

mahjqa

    Posts: 456
    Joined: 17-November 04
    Member: 108

Posted 14 May 2011 - 02:39 PM

Some examples of said mosaics:

Posted Image

Posted Image

Posted Image

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, 14 May 2011 - 04:27 PM.


#15 Lasse D

Lasse D

  • Pink Poodle


    Posts: 974
    Joined: 24-December 06
    Member: 1144
    Country: Denmark

Posted 14 May 2011 - 08:46 PM

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.
Posted Image Posted Image Posted Image
Posted Image Posted Image Posted Image

#16 mahjqa

mahjqa

    Posts: 456
    Joined: 17-November 04
    Member: 108

Posted 15 May 2011 - 12:14 AM

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?

#17 Lasse D

Lasse D

  • Pink Poodle


    Posts: 974
    Joined: 24-December 06
    Member: 1144
    Country: Denmark

Posted 16 May 2011 - 01:48 PM

View Postmahjqa, on 15 May 2011 - 12:14 AM, said:

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, 16 May 2011 - 01:49 PM.

Posted Image Posted Image Posted Image
Posted Image Posted Image Posted Image

#18 Matanuilover

Matanuilover

    Posts: 34
    Joined: 15-January 11
    Member: 15441

Posted 21 May 2011 - 10:38 PM

View PostLasse D, on 16 May 2011 - 01:48 PM, said:

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.
If "guns don't kill minifigs, minifigs kill minifigs," does that mean that toasters don't toast toast, TOAST TOASTS TOAST?

#19 Lasse D

Lasse D

  • Pink Poodle


    Posts: 974
    Joined: 24-December 06
    Member: 1144
    Country: Denmark

Posted 22 May 2011 - 11:00 PM

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.
Posted Image Posted Image Posted Image
Posted Image Posted Image Posted Image

#20 legolijntje

legolijntje

    Posts: 2336
    Joined: 06-June 10
    Member: 11214
    Country: The Netherlands

Posted 28 May 2011 - 12:22 PM

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:

#21 Calabar

Calabar

    Posts: 2444
    Joined: 11-April 10
    Member: 10232
    Country: Italy

Posted 28 May 2011 - 01:53 PM

A feature I'd love would be to create a lxf or ldr file, so that I could have my "virtual" mosaic in 3D.
"Official LEGO Sets made in LDD" topic: Read guidelines before posting!

#22 legolijntje

legolijntje

    Posts: 2336
    Joined: 06-June 10
    Member: 11214
    Country: The Netherlands

Posted 28 May 2011 - 02:59 PM

View PostCalabar, on 28 May 2011 - 01:53 PM, said:

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, 28 May 2011 - 03:00 PM.


#23 DLuders

DLuders

  • Technic Technician


    Posts: 5817
    Joined: 17-October 09
    Member: 7868
    Country: USA (WA State)

Posted 28 May 2011 - 07:53 PM

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):

Posted Image

#24 Lasse D

Lasse D

  • Pink Poodle


    Posts: 974
    Joined: 24-December 06
    Member: 1144
    Country: Denmark

Posted 28 May 2011 - 09:47 PM

View Postlegolijntje, on 28 May 2011 - 02:59 PM, said:

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.
Posted Image Posted Image Posted Image
Posted Image Posted Image Posted Image

#25 legolijntje

legolijntje

    Posts: 2336
    Joined: 06-June 10
    Member: 11214
    Country: The Netherlands

Posted 29 May 2011 - 07:36 AM

View PostLasse D, on 28 May 2011 - 09:47 PM, said:

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users