Best way to create a collage (in Java)
Asked Answered
M

1

7

I want to create a collage of photos. Similar to this image (think of photos instead of those colored rectangles):

Collage

The collage should be constructed from the following information.

We have a 2d map of slots and set of images. The map (in this case 3x3 slots) looks like this:

| s1 | s2 | s3 |
| s4 | s5 | s6 |
| s7 | s8 | s9 |

Now, for each image we know to which slot it belongs. Also, it might be the case that no image belongs to a particular slot; however, more than one image can belong to one particular slot (we might have more than 9 images).

In addition to this, if more than one image belong to a particular slot, we know to which degrees the images belong to that slot.

So, what would be the best way to create a collage (in Java) that looks beautiful but still preserves the structure of the above map?

(To get this 2d map we are using a Kohonen map)

Mordecai answered 23/5, 2012 at 13:28 Comment(4)
This smells like homework. What have you tried so far?Underdrawers
This is not really a homework. I also don't expect code snippets but rather some ideas. I only mentioned Java if there might be some available libraries somebody is aware of.Mordecai
I would recommend narrowing the focus then. There is no real "best" way to do this, and it's far too broad and subjective. Try reforming the question with either a specific approach or specific language in mind.Underdrawers
Use a Vector in each slot, use the vector index as the image degree. Then put all the slots (Vectors) into a two dimensional array. But I couldn't figure out the actual connection between the screenshot you provided and the map.Mcquade
C
0

You could have a value (xa) that +='s the width of the image which is drawn onto the canvas everytime, and then set the next image x position relative to xa, then use modulus on that value constantly, but then use division to work out the Y value of the next image (xa / pageWidth). This was improvised, i apologise if it doesn't make sense.

Carrefour answered 25/10, 2012 at 19:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.