Creating Images from Images

Discuss digital image processing techniques and algorithms. We encourage its application to ImageMagick but you can discuss any software solutions here.
Post Reply
madkins1868
Posts: 4
Joined: 2011-02-07T11:59:35-07:00
Authentication code: 8675308

Creating Images from Images

Post by madkins1868 »

I am currently tasked with developing a piece of software. The purpose of the software is to allow us to take small images, and use them to generate larger images. An example of the technique to be used can be seen here:

http://www.viningsgallery.com/featured- ... onroe.php4

For an original piece I have to spray paint a stencil onto a canvas individually, which is very time consuming. I'm hoping to build some software that allows me to maintain an inventory of images. These images would be selected and then used to create a new image (Marilyn Monroe in this example) using a random combination of the base images. The shadows are important, but could possibly be added later?

Wondering if anyone knows of a software solution that is available today to do this? If not, maybe some guidance on the algorithm required to accomplish this? Any assistance would be greatly appreciated.

Mark
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Creating Images from Images

Post by Bonzo »

Something similar was tried last year but the OP has removed his images:
viewtopic.php?f=1&t=17259
madkins1868
Posts: 4
Joined: 2011-02-07T11:59:35-07:00
Authentication code: 8675308

Re: Creating Images from Images

Post by madkins1868 »

Thank you for your prompt reply.

I'm confused, as I can't tell how these are related. Its difficult to understand without the image downloads I assume. Any idea on what is being done?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Creating Images from Images

Post by Bonzo »

The original objective was to have the users name spelt out with little drummers? ( you have at half time in american football games ).

It started with an empty field and the drummers or what ever were added to the field at points along the text.

You could try and create the points using some code or could probably input them from a text file - could use a graphics tablet to pick the points ?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Creating Images from Images

Post by Bonzo »

Why do you not have all your people images as layers in your graphics program; load the base layer e.g. Marilyn Monroe; drag and drop the people over the base layer. When you are happy with the placements hide the base layer and merge all the other layers - or am I missing something ?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Creating Images from Images

Post by Bonzo »

A real basic example that would need a lot of work to do what you want: http://www.rubble.info/donotdelete/Drummers/imap.php
Places a "flag" wherever you click.

It could use random "flags"; use a sketch as a base layer but only modify the top layer so the base layer could be removed later etc. undo could be a problem :?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Creating Images from Images

Post by fmw42 »

I think Anthony has had some experience with this effect. Hopefully he will respond.

I think one approach is the get a large collection of tiny images for which you have measured the average color or graylevel and stored that in a database. Then block out the large image and for each block get its average color. That can be done by using -filter block and downsampling the image using -filter block -resize, where the blocksize and downsampling is such that the blocks are the size of the tiny images (presumed all the same size). Then each pixel in the reduced image represent the average color or graylevel desired. Then append, flatten or montage all the tiny images selected to match the given block average color from your database of tiny images.
madkins1868
Posts: 4
Joined: 2011-02-07T11:59:35-07:00
Authentication code: 8675308

Re: Creating Images from Images

Post by madkins1868 »

Thank you all of you for responding.

@Bonzo - the issue isn't with placement of the images on a canvas. The software actually needs to "read" an image, and then recreate the image using a second image - and this needs to be done without user input. The issue we have now is the amount of time a this type of image takes when it is done manually by our painters. We've tried to do it manually using Photoshop, but it really doesn't decrease the time it takes.

Thank you again for your replies.

Mark
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Creating Images from Images

Post by Bonzo »

Mark

I didn't think it was going to be a lot of images but you were just doing one or two.

Another thread that came up before was this one: viewtopic.php?f=1&t=17389&hilit=glennrp

As Fred says Anthony is the best one for help with this and I would post again in the user section as you may get more responce there.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Creating Images from Images

Post by anthony »

Bonzo wrote:Something similar was tried last year but the OP has removed his images:
viewtopic.php?f=1&t=17259
Just a repeat of the major Cavat... using a convolve to expand points into a common image works unless the images overlaps. That is because convolutions effectively does a 'plus' or addition composition. Also it will only replicate a single common image.

For multiple different sub-images you will need to do an overlay.

HOWEVER: you can do a mixture. You can use a convolution method to create one layer for one type of sub-image (well separated), and then overlay the multiple layers (using flatten, mosaic, merge, or just place composition) so the overlapping sub-images can handle. Note however that doing this will mean all sub-images of one type will be above or below sub-images of another type.

The best solution is probably the slowest. Overlay each sub-image in a top of image to bootom of image order, so the overlaps have 'foreground' sub-images in front of sub-images that are supposedly more distant. However this would be VERY slow.

ASIDE the slowness for this is NOT in the composition, as IM compose will limit the changes to just the overlay area. The slowness would be in the data copy that Im would make to generate the resulting image. I am not however sure if the image data gets cloned by the ComposeImage() or the API. Some check of the actual processing steps for a compostion may be needed to get an answer to this.

Look at the 'cloning' notes for re-using a single image that is loaded and then cloned to generate multiple layers. This is also in the above drummers discussion.

And PLEASE give us more feedback of your successes and failures.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Creating Images from Images

Post by anthony »

fmw42 wrote:I think one approach is the get a large collection of tiny images for which you have measured the average color or graylevel and stored that in a database. Then block out the large image and for each block get its average color.
You would want some randomness (random dither?) in the placement of the images, but essentially this would be a great soultion for filling 'areas' in the image with sub-images.

I have not done this myself but would love to see some examples and work. Figuring out placements is the tricky part, and is harder than the drummers problem (which had definitive placements from a 'dot' font).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Creating Images from Images

Post by anthony »

Bonzo wrote:Mark

I didn't think it was going to be a lot of images but you were just doing one or two.

Another thread that came up before was this one: viewtopic.php?f=1&t=17389&hilit=glennrp

As Fred says Anthony is the best one for help with this and I would post again in the user section as you may get more responce there.
There was further discussion and a different, cleaner, pixelated ordered-dither solution given in another later discussion

B/W Halftone Dither
viewtopic.php?f=1&t=17389&p=67849#p67849
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
madkins1868
Posts: 4
Joined: 2011-02-07T11:59:35-07:00
Authentication code: 8675308

Re: Creating Images from Images

Post by madkins1868 »

This appears to be a more complex problem than we anticipated. Does anyone know of any developers who might be willing to build what we need (that understand what we want to do, and the work involved)? Any help would be appreciated.
Post Reply