473,414 Members | 1,707 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,414 software developers and data experts.

image height and width

14
Hi,
any suggestions on how to get width and height of an image from an image file? And further, how to get the color value at any point of the image?
Sep 4 '07 #1
5 9384
bartonc
6,596 Expert 4TB
Hi,
any suggestions on how to get width and height of an image from an image file? And further, how to get the color value at any point of the image?
That will depend entirely on the type of image and the tools that you are using.
PIL & Tkinter? wxPython? Other? Working with gif, tiff, png, jpeg, etc????
Sep 4 '07 #2
Memozio
14
Hey,
I'm using .png image files. I'm working with FrogLogic configured to use Python language.I've already learned that I can use PIL for that, for example:

from PIL import image
im=Image.image("image.png")
pring im.size

and it will return tuple of the format (width, height). I'm wondering if I can somehow get those values in separate statements so I can store them for future use in my script!?
Sep 4 '07 #3
bartonc
6,596 Expert 4TB
Hey,
I'm using .png image files. I'm working with FrogLogic configured to use Python language.I've already learned that I can use PIL for that, for example:

from PIL import image
im=Image.image("image.png")
pring im.size

and it will return tuple of the format (width, height). I'm wondering if I can somehow get those values in separate statements so I can store them for future use in my script!?
Expand|Select|Wrap|Line Numbers
  1. width, height = im.size
will "unpack" the tuple. This method is used often, but the tuple size must match the variable assignments or it will throw an exception.
Sep 4 '07 #4
Memozio
14
Expand|Select|Wrap|Line Numbers
  1. width, height = im.size
will "unpack" the tuple. This method is used often, but the tuple size must match the variable assignments or it will throw an exception.

Thank you, Mr. Barton)))
it really helped me!
Sep 4 '07 #5
bartonc
6,596 Expert 4TB
Thank you, Mr. Barton)))
it really helped me!
You are quite welcome. That's what we are here for.

Keep posting,
Barton
Sep 4 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Ana | last post by:
I just ran a report on a site I'm redesigning and came up with all these missing height/width tags. How important are they? Should I go through the trouble of making sure they're there? Ana
1
by: Pums | last post by:
How to get the information(like height, width) of an image to be uploaded?
9
by: Adam | last post by:
Can someone please help!! I am trying to figure out what a font is? Assume I am working with a fixed font say Courier 10 point font Question 1: What does this mean 10 point font Question 2:...
1
by: Blake Versiga | last post by:
After pulling an image from the data base and the Image.Height and Image.Width are not set to the ImageURL's attributes. 1) Is there a way to have these properties updated? or 2) How do I get...
1
by: Mustafa Rabie | last post by:
dear all, i am writing an application where the user can upload his own picture. I wanted to get the Width and Height of the uploaded picture. So i assigned the uploaded image to an aspnet...
1
by: comp.lang.php | last post by:
Sorry folks, I'm on a roll!!! I need to calculate the height or width of an image if you change either the width or height and don't change BOTH of them at the same time, this is to "vector" the...
18
by: pecan | last post by:
I have hundreds of pictures on my site. The thumbnails are all a standard size, and most of the bigger ones are the same size too. When I run my html code through my optimizer it throws out a...
8
by: Kentor | last post by:
Hello, I have users that submit images to my website. By default I choose to make the width bigger than the height because usually pictures are taken horizontally... But in some cases people take...
2
by: bizt | last post by:
Hi, Is it possible to obtain the width/ height of an image when that image is dyanically created using a PHP script and passing GET attributes. For example: <img...
2
by: vishwa Ram | last post by:
Hi all, How to get tiff image height and width using Image object in VB. Thanks, vishwa Ram.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.