473,322 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to add few pictures into one

Lad
Hello ,
is it possible to add( with PYTHON language) several image files into
one?
Thanks for reply
L.

Jun 5 '06 #1
15 2945
Lad wrote:
Hello ,
is it possible to add( with PYTHON language) several image files into
one?


Google for 'Python Imaging Library'...

Regards
Sreeram

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEhCoTrgn0plK5qqURApwkAKCMlXC016OG4LJpQVpJOa matK+q6QCfQ9bR
MmrLXAD6JSh2aINEcrZRVds=
=W2Ow
-----END PGP SIGNATURE-----

Jun 5 '06 #2
Lad

K.S.Sreeram wrote:
Lad wrote:
Hello ,
is it possible to add( with PYTHON language) several image files into
one?


Google for 'Python Imaging Library'...

Regards
Sreeram

Thank you for your reply.
I was thinking about this:
to open each image file in binary mode , read it and write into the
result image file?
Is that possible?
Regards,
L

Jun 5 '06 #3
On 2006-06-05, Lad <py****@hope.cz> wrote:
is it possible to add( with PYTHON language) several image
files into one?


Google for 'Python Imaging Library'...


I was thinking about this: to open each image file in binary
mode , read it and write into the result image file? Is that
possible?


Yes.

--
Grant Edwards grante Yow! I have many CHARTS
at and DIAGRAMS...
visi.com
Jun 5 '06 #4
Lad wrote:
K.S.Sreeram wrote:
Lad wrote:
Hello ,
is it possible to add( with PYTHON language) several image files into
one?


Google for 'Python Imaging Library'...

Regards
Sreeram


Thank you for your reply.
I was thinking about this:
to open each image file in binary mode , read it and write into the
result image file?
Is that possible?
Regards,
L

Of course, but what you haven't said yet is how you want the resulting
image file to behave. Do you want it to contain tiled copies of the
original images, or be an animation with each frame being one of the
original images, or something else I haven't thought of.

We aren't mind readers here.

though-some-regulars-get-close-ly y'rs - steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Love me, love my blog http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

Jun 5 '06 #5
Lad

Steve Holden wrote:
Lad wrote:
K.S.Sreeram wrote:
Lad wrote:

Hello ,
is it possible to add( with PYTHON language) several image files into
one?

Google for 'Python Imaging Library'...

Regards
Sreeram


Thank you for your reply.
I was thinking about this:
to open each image file in binary mode , read it and write into the
result image file?
Is that possible?
Regards,
L

Of course, but what you haven't said yet is how you want the resulting
image file to behave. Do you want it to contain tiled copies of the
original images, or be an animation with each frame being one of the
original images, or something else I haven't thought of.

We aren't mind readers here.

though-some-regulars-get-close-ly y'rs - steve
--

Steve
Thank you for your reply
All that I want is this:
I download ( via Python) some pictures from internet and I want to add
all these pictures into one =one file/
So far, I managed to download pictures but I do not know how to add i
them nto one file.
How can I do that?
Thank you for reply and help
L.

Jun 5 '06 #6
Lad wrote:
Steve Holden wrote:
Lad wrote:
K.S.Sreeram wrote:
Lad wrote:
>Hello ,
>is it possible to add( with PYTHON language) several image files into
>one?

Google for 'Python Imaging Library'...

Regards
Sreeram


Thank you for your reply.
I was thinking about this:
to open each image file in binary mode , read it and write into the
result image file?
Is that possible?
Regards,
L


Of course, but what you haven't said yet is how you want the resulting
image file to behave. Do you want it to contain tiled copies of the
original images, or be an animation with each frame being one of the
original images, or something else I haven't thought of.

We aren't mind readers here.

though-some-regulars-get-close-ly y'rs - steve
--


Steve
Thank you for your reply
All that I want is this:
I download ( via Python) some pictures from internet and I want to add
all these pictures into one =one file/
So far, I managed to download pictures but I do not know how to add i
them nto one file.
How can I do that?
Thank you for reply and help
L.

Zip file? Image file? "Add all these pictures into one file" isn't (fro
me) a sufficient specification.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Love me, love my blog http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

Jun 5 '06 #7
Lad

All that I want is this:
I download ( via Python) some pictures from internet and I want to add
all these pictures into one =one file/
So far, I managed to download pictures but I do not know how to add i
them nto one file.
How can I do that?
Thank you for reply and help
L.

Zip file? Image file? "Add all these pictures into one file" isn't (fro
me) a sufficient specification.


I want to to do that as easy as possible. I think the easest way could
be add( append) an image to another into an image file so that I can
use an image browser and see all pictures in one file.
Is that possible?
Thank you for reply
L.

Jun 6 '06 #8
Lad wrote:
I want to to do that as easy as possible.
But not even more easy.

I think the easest way could be add( append) an image to another
into an image file so that I can use an image browser and see all
pictures in one file. Is that possible?


Well, you can do it with PIL, creating a very big white image and
putting on it all the images, as tiles.
But probably you want to do something different.
Maybe you can use PyUNO to create a PowerPoint-like (Presentation) file
with an image on each page.
If you are on Win another easy way is to create an Html page that shows
all the pics, open it with Explorer and save it as a single HMT file.
Probably there are other solutions.

Bye,
bearophile

Jun 6 '06 #9
Lad

be************@lycos.com wrote:
Lad wrote:
I want to to do that as easy as possible.


But not even more easy.

I think the easest way could be add( append) an image to another
into an image file so that I can use an image browser and see all
pictures in one file. Is that possible?


Well, you can do it with PIL, creating a very big white image and
putting on it all the images, as tiles.
But probably you want to do something different.
Maybe you can use PyUNO to create a PowerPoint-like (Presentation) file
with an image on each page.
If you are on Win another easy way is to create an Html page that shows
all the pics, open it with Explorer and save it as a single HMT file.
Probably there are other solutions.


I was thinking about much less complicated task.
I thought about this:
Open a picture file( download it from internet) and write it in a
result file( being open in binary mode).
Then download another file and append to the result file.
And so on...
But is it possible? Will be the pictures in the result file seen
well??
regards,
L.

Jun 6 '06 #10
Lad wrote:
Open a picture file( download it from internet) and write it in a
result file( being open in binary mode).
Then download another file and append to the result file.
And so on...
But is it possible? Will be the pictures in the result file seen
well??


the internal structure of an image file is quite a bit more complicated
than the internal structure of a text file, so it's not very likely that
you would get very far with that approach.

why not just put all the files in a directory, and use an image viewer
with collage or slideshow support ?

</F>

Jun 6 '06 #11
Lad

Fredrik Lundh wrote:
Lad wrote:
Open a picture file( download it from internet) and write it in a
result file( being open in binary mode).
Then download another file and append to the result file.
And so on...
But is it possible? Will be the pictures in the result file seen
well??


the internal structure of an image file is quite a bit more complicated
than the internal structure of a text file, so it's not very likely that
you would get very far with that approach.

why not just put all the files in a directory, and use an image viewer
with collage or slideshow support ?

Fredrik,
Thank you for your reply.
I really would like to have ALL pictures in one file.
So, what would be the easiest/best way how to do that?
Thank you for your reply
regards,
L.

Jun 6 '06 #12
Lad wrote:
I really would like to have ALL pictures in one file.
So, what would be the easiest/best way how to do that?


do you want to look at the images as a slideshow or as a collage?

</F>

Jun 6 '06 #13
Lad wrote:
I really would like to have ALL pictures in one file.


import Image

def merge_images( input_files, output_file ) :
img_list = [Image.open(f) for f in input_files]
out_width = max( [img.size[0] for img in img_list] )
out_height = sum( [img.size[1] for img in img_list] )
out = Image.new( 'RGB', (out_width,out_height) )
y = 0
for img in img_list :
w,h = img.size
out.paste( img, (0,y,w,y+h) )
y += h
out.save( output_file )

Use like this:
merge_images( ['1.jpg','2.jpg','3.jpg'], 'output.jpg' )


Regards
Sreeram
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEhWhBrgn0plK5qqURAmPfAJ0cdYGpm5QCMWvjzNEEoC 2hQDwWvgCeOdQ5
OPOPUAsQz3g7/ZKXf1opa0w=
=E9kT
-----END PGP SIGNATURE-----

Jun 6 '06 #14
Lad

Fredrik Lundh wrote:
Lad wrote:
I really would like to have ALL pictures in one file.
So, what would be the easiest/best way how to do that?


do you want to look at the images as a slideshow or as a collage?

</F>

As a collage only

Jun 6 '06 #15
Lad

K.S.Sreeram wrote:
Lad wrote:
I really would like to have ALL pictures in one file.
import Image

def merge_images( input_files, output_file ) :
img_list = [Image.open(f) for f in input_files]
out_width = max( [img.size[0] for img in img_list] )
out_height = sum( [img.size[1] for img in img_list] )
out = Image.new( 'RGB', (out_width,out_height) )
y = 0
for img in img_list :
w,h = img.size
out.paste( img, (0,y,w,y+h) )
y += h
out.save( output_file )

Use like this:
merge_images( ['1.jpg','2.jpg','3.jpg'], 'output.jpg' )


Regards

Sreeram,
Thanks a lot

--------------enig1BF4CF77824C603826EE139D
Content-Type: application/pgp-signature
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="signature.asc"
Content-Description: OpenPGP digital signature
X-Google-AttachSize: 253


Jun 7 '06 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bob Bedford | last post by:
I've been able to parse the XML files used to update my database. Now, I receive image in XML files, like this: <PICTURES COUNT="3" CDATA="1"> <PIC NR="1"><!]></PIC> <PIC...
0
by: JakeC | last post by:
Hey all, I'm currently redesigning a website that a friend and I started about a year ago. It is a daily surf report so when choosing the best script/language to use for the new design, I found...
1
by: Sven Steinacker | last post by:
Hi, XSLT files generated by Microsoft InfoPath applied to an applicable XML file produces quite decent HTML presentations. At least with Mozilla and, of course, IE 6.0 the results look the same...
0
by: Marcel - IDUG Europe 2005 | last post by:
Visit the blog for a virtual experience of the conference. Check out the blog at: http://idugeurope.blogspot.com Here are some previous posts: - Pictures Live on Tuesday
3
by: Pedro Maria Ferro da Cunha | last post by:
I spend a lot of time making 2 thousand pictures and saving them as an article name. jpg. I have a table with the article name and name of the file in jpg (format). How can I make an...
12
by: Wadim Grasza | last post by:
I want to store and display (on a form or a report) multiple pictures per record in an access database. The pictures are not stored within the database. They are stored as files and the database...
13
by: gooze | last post by:
Hello I am working on an applicaion that shows several pictures on a webpage. These pictures are saved in a MySQL DB as BLOB. I noticed, that the web server suffers in its performance by...
1
by: suresh_punniyakkodi | last post by:
Hellow, I am suresh, i am developing one project in VB. I need your help. My question is how to zoom pictures(zoom in and zoom out) in Visual Basic (like Photo Editor). ...
4
by: Zeljko Bilandzija | last post by:
Hy, could someone help me in this: In design mode, i want to put pictures in database. I made column named pics, and its type as image. How can I put pictures or some address of these pictures...
2
by: Tyler | last post by:
I need to have a form that displays a group of 20 pictures in 4 rows of 5 pictures. The pictures are of people. Each Subject record has a picture field. I have a query written that selets the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.