Re: [gentoo-user] [O.T] photomosaic

2006-12-19 Thread Kumar Golap

Have you tried hugin

http://hugin.sourceforge.net/

I think its in portage

Kumar


On 12/14/06, Arnau Bria [EMAIL PROTECTED] wrote:

On Thu, 14 Dec 2006 14:30:17 +
Redouane Boumghar wrote:

 Hello Arnau
Hi,

 I'm sorry I didn't understand what you were looking for.
It's ok, I must improve my English!

 I proposed Image Magick and it sure can do it but with a little
 head-scratch.

 So if i may resume u need :
 - A parent picture
 - A list of other pictures to fill the mosaic

that's it!

 With Image Magick you can extract a portion (according to you
 discretization parameters) from the parent picture and then compare
 it with the list of pictures you have by comparing metrics like RMSE
 and then compose your mosaic with most revelant pictures at each
 portion of the parent one.

 I'll post a shell script for this if I have time.
 This could be fun,
That would be nice!

 Have a good day and tell me if you find a program that does it,
at this point I have only found metapixel :-( it's nice, but i'm
looking for something better.

 Red.
Thanks!
--
Arnau Bria
http://blog.emergetux.net
Wiggum: Dispara a las ruedas Lou.
Lou: eee, es un tanque jefe.
Wiggum: Me tienes hartito con todas tus excusas.
--
gentoo-user@gentoo.org mailing list



--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] [O.T] photomosaic

2006-12-19 Thread Alan E. Davis

Picasa does awesome mosaics.

Alan

On 12/20/06, Kumar Golap [EMAIL PROTECTED] wrote:

Have you tried hugin

http://hugin.sourceforge.net/

I think its in portage

Kumar


On 12/14/06, Arnau Bria [EMAIL PROTECTED] wrote:
 On Thu, 14 Dec 2006 14:30:17 +
 Redouane Boumghar wrote:

  Hello Arnau
 Hi,

  I'm sorry I didn't understand what you were looking for.
 It's ok, I must improve my English!

  I proposed Image Magick and it sure can do it but with a little
  head-scratch.
 
  So if i may resume u need :
  - A parent picture
  - A list of other pictures to fill the mosaic

 that's it!

  With Image Magick you can extract a portion (according to you
  discretization parameters) from the parent picture and then compare
  it with the list of pictures you have by comparing metrics like RMSE
  and then compose your mosaic with most revelant pictures at each
  portion of the parent one.
 
  I'll post a shell script for this if I have time.
  This could be fun,
 That would be nice!

  Have a good day and tell me if you find a program that does it,
 at this point I have only found metapixel :-( it's nice, but i'm
 looking for something better.

  Red.
 Thanks!
 --
 Arnau Bria
 http://blog.emergetux.net
 Wiggum: Dispara a las ruedas Lou.
 Lou: eee, es un tanque jefe.
 Wiggum: Me tienes hartito con todas tus excusas.
 --
 gentoo-user@gentoo.org mailing list


--
gentoo-user@gentoo.org mailing list





--
Alan Davis, Kagman High School, Saipan  [EMAIL PROTECTED] 1-670-256-2043

I consider that the golden rule requires that if I like a program I
must share it with other people who like it.
 Richard Stallman
--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] [O.T] photomosaic

2006-12-18 Thread Francisco Ares

A friend of mine built this Python script, I'm sure he doesn't mind ;)


#!/usr/bin/env python
# by Andre Bocchini

import sys
import os
import string
import getopt
import Image
import ImageFilter
import ImageStat

def usage():
Displays information on how to use the program. 

   print
   print Usage : mosaic.py [options]
   print Required:
   print   -i input-img   Source image for the mosaic
   print   -s img-dir Directory where other images are located
   print   -o output-img  Final mosaic image
   print   -b blocks  Number of blocks per row in the mosaic
   print   -w width   Final mosaic width
   print   -h height  Final mosaic height
   print   -t threshold   Sensitivity of the image analyzer
   print Optional:
   print   --help   Displays this help information
   print


def calculate_block_means(filename, blocks_in_row):
Breaks an image into a matrix that has blocks_in_row x blocks_in_row
number of blocks, takes a mean of the RGB values of each block, and
stores this mean into a list that is returned to the caller. 

   block_mean_list = []

   image = Image.open(filename)
   size = image.size
   block_width = size[0] / blocks_in_row
   block_height = size[1] / blocks_in_row

   curr_block = 0
   slice = Image.new(RGB, (block_width, block_height))
   for i in range(0, blocks_in_row):
   for j in range(0, blocks_in_row):
   for y_offset in range(0, block_height):
   for x_offset in range(0, block_width):
   startx = j * block_width
   starty = i * block_height
   slice.putpixel((x_offset, y_offset),\
image.getpixel((startx + x_offset, starty + y_offset)))

   slice_stat = ImageStat.Stat(slice)
   slice_mean = slice_stat.mean
   slice_r_mean = slice_mean[0]
   slice_g_mean = slice_mean[1]
   slice_b_mean = slice_mean[2]
   final_slice_mean = (slice_r_mean + slice_g_mean + slice_b_mean) / 3

   block_mean_list.append(final_slice_mean)
   curr_block = curr_block + 1
   #print  Block mean for block %d: %d % (i+j, final_slice_mean)

   return block_mean_list


def build_mean_list(image_directory):
Scans a directory for image files, takes the mean of the RGB values
   in each image file, and stores these mean values into a list.  Each
   element in this list contains a pair of image file name and mean RGB
   value.  The list is returned to the caller. 

   image_mean_list = []
   # In order to avoid some repetition in the images used for flat dark areas,
   # we keep a least recently used flag for every image.
   lru_list = []
   images = os.listdir(image_directory)

   for filename in images:
   try:
   # This is the next image in the list
   image = Image.open(image_directory + / + filename)

   # Getting mean values for the current image
   img_stat = ImageStat.Stat(image)
   img_mean = img_stat.mean
   img_r_mean = img_mean[0]
   img_g_mean = img_mean[1]
   img_b_mean = img_mean[2]
   final_img_mean = (img_r_mean + img_g_mean + img_b_mean) / 3

   image_mean_list.append((image_directory + / + filename,\
   final_img_mean))
   lru_list.append(0)
   except IOError:
   pass
   except:
   print +++ Unknown error encountered while building mean list

   return image_mean_list, lru_list


if __name__ == __main__:
   # Parse command line
   try:
   opts, args = getopt.getopt(sys.argv[1:], i:s:o:b:w:t:h:, [help])
   except getopt.GetoptError:
   usage()
   sys.exit(-1)

   in_image_name = None
   src_image_dir = None
   out_image_name = None
   out_image_width = -1
   out_image_height = -1
   blocks_in_row = -1
   threshold = 10

   for option, value in opts:
   if option == --help:
   usage()
   sys.exit(0)
   if option == -i:
   in_image_name = value
   if option == -o:
   out_image_name = value
   if option == -s:
   src_image_dir = value
   if option == -t:
   threshold = string.atoi(value)
   if option == -w:
   out_image_width = string.atoi(value)
   if option == -h:
   out_image_height = string.atoi(value)
   if option == -b:
   blocks_in_row = string.atoi(value)

   # Checking for invalid input
   error = False
   if in_image_name == None:
   print  You must specify an input image
   error = True
   if out_image_name == None:
   print  You must specify an output image
   error = True
   if src_image_dir == None:
   print  You must specify an image src directory
   error = True
   if blocks_in_row  0:
   print  You must specify a valid number of blocks in a row
   error = True
   if error == True:
   usage()
   sys.exit(-1)

   # Display useful information
   print  

[gentoo-user] [O.T] photomosaic

2006-12-14 Thread Arnau Bria
Hi,

does anyone know any application for generating photomosaics?

something like metapixel:
http://www.complang.tuwien.ac.at/~schani/metapixel/

Thanks in advance,

-- 
Arnau Bria
http://blog.emergetux.net
Wiggum: Dispara a las ruedas Lou.
Lou: eee, es un tanque jefe.
Wiggum: Me tienes hartito con todas tus excusas.
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] [O.T] photomosaic

2006-12-14 Thread Redouane Boumghar

Hi everyone,

One can use Image Magick for building multi-images mosaics
with command-line tools (minimum CPU load).

Get Image Magick :
http://www.imagemagick.org/

How to use it for building mosaics :
http://www.cit.gu.edu.au/~anthony/graphics/imagick6/mosaics/

Hope it helps,
R. Boumghar.

Arnau Bria wrote:

Hi,

does anyone know any application for generating photomosaics?

something like metapixel:
http://www.complang.tuwien.ac.at/~schani/metapixel/

Thanks in advance,



--
+
Redouane BOUMGHAR

 Email:  [EMAIL PROTECTED]
 Tel:+33(0) 561 285 685
 Mobile: +33(0) 623 830 444
+
MAGELLIUM  @  http://www.magellium.fr/
+

--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] [O.T] photomosaic

2006-12-14 Thread Arnau Bria
On Thu, 14 Dec 2006 11:07:06 +
Redouane Boumghar wrote:

 Hi everyone,
Hi,
 
 One can use Image Magick for building multi-images mosaics
 with command-line tools (minimum CPU load).
 
 Get Image Magick :
 http://www.imagemagick.org/
 
 How to use it for building mosaics :
 http://www.cit.gu.edu.au/~anthony/graphics/imagick6/mosaics/

Mmmm... With a quick look at description, I think this is not exaclty
want I'm looking for...
What I wanted to say with photomosaic, is a group of pictures wich
draw an other one
( http://www.complang.tuwien.ac.at/~schani/metapixel/examples.html)


 Hope it helps,
 R. Boumghar.
Thanks for your reply! 
Cheers

-- 
Arnau Bria
http://blog.emergetux.net
Wiggum: Dispara a las ruedas Lou.
Lou: eee, es un tanque jefe.
Wiggum: Me tienes hartito con todas tus excusas.
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] [O.T] photomosaic

2006-12-14 Thread Redouane Boumghar

Hello Arnau

I'm sorry I didn't understand what you were looking for.

I proposed Image Magick and it sure can do it but with a little head-scratch.

So if i may resume u need :
- A parent picture
- A list of other pictures to fill the mosaic

With Image Magick you can extract a portion (according to you discretization 
parameters) from the parent picture and then compare it with the list of pictures

you have by comparing metrics like RMSE and then compose your mosaic
with most revelant pictures at each portion of the parent one.

I'll post a shell script for this if I have time.
This could be fun,

Have a good day and tell me if you find a program that does it,
Red.


Mmmm... With a quick look at description, I think this is not exaclty
want I'm looking for...
What I wanted to say with photomosaic, is a group of pictures wich
draw an other one
( http://www.complang.tuwien.ac.at/~schani/metapixel/examples.html)



--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] [O.T] photomosaic

2006-12-14 Thread Arnau Bria
On Thu, 14 Dec 2006 14:30:17 +
Redouane Boumghar wrote:

 Hello Arnau
Hi,
 
 I'm sorry I didn't understand what you were looking for.
It's ok, I must improve my English!
 
 I proposed Image Magick and it sure can do it but with a little
 head-scratch.
 
 So if i may resume u need :
 - A parent picture
 - A list of other pictures to fill the mosaic

that's it! 

 With Image Magick you can extract a portion (according to you
 discretization parameters) from the parent picture and then compare
 it with the list of pictures you have by comparing metrics like RMSE
 and then compose your mosaic with most revelant pictures at each
 portion of the parent one.
 
 I'll post a shell script for this if I have time.
 This could be fun,
That would be nice!
 
 Have a good day and tell me if you find a program that does it,
at this point I have only found metapixel :-( it's nice, but i'm
looking for something better.

 Red.
Thanks!
-- 
Arnau Bria
http://blog.emergetux.net
Wiggum: Dispara a las ruedas Lou.
Lou: eee, es un tanque jefe.
Wiggum: Me tienes hartito con todas tus excusas.
-- 
gentoo-user@gentoo.org mailing list