473,403 Members | 2,222 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,403 software developers and data experts.

resampling images

Hello,

I was wondering if I was missing something simple, an existing
function, that allows me to resample image in size (width and height)
as well as the file size as well.

What I am trying to do is automate importing images and standardize
the saved version to a typical dimension and maximum file sie (80Kb).

I have found numerous scripts for resample the dimensions of an image
but file size seems trickier to find or I'm not looking in the right
places.

Any pointers, help is greatly appreciated.

Oct 26 '07 #1
2 4498
Daniel <d_********@hotmail.comwrote:
>
I was wondering if I was missing something simple, an existing
function, that allows me to resample image in size (width and height)
as well as the file size as well.

What I am trying to do is automate importing images and standardize
the saved version to a typical dimension and maximum file size (80Kb).

I have found numerous scripts for resample the dimensions of an image
but file size seems trickier to find or I'm not looking in the right
places.
What format? The file size is determined by the width, height, and
compression factor. Uncompressed images of a particular width and height
will always be the same size. With compressed images, like JPEG, you can
tweak the compression quality to adjust the file size, within certain
limits.

So, basically, you should choose your dimensions so that the size is
roughly in the range you want.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 27 '07 #2
Hi,

You can use the Imagemagick convert command with -resample, -quality,
and -sampling-factor to adjust the compression. See the docs here:

http://imagemagick.org/script/comman...s.php#resample

For GD, you can use this nifty function that includes a quality
parameter:

http://us.php.net/manual/en/function...pled.php#77679

On Oct 26, 5:00 pm, Daniel <d_pinea...@hotmail.comwrote:
Hello,

I was wondering if I was missing something simple, an existing
function, that allows me to resample image in size (width and height)
as well as the file size as well.

What I am trying to do is automate importing images and standardize
the saved version to a typical dimension and maximum file sie (80Kb).

I have found numerous scripts for resample the dimensions of an image
but file size seems trickier to find or I'm not looking in the right
places.

Any pointers, help is greatly appreciated.

Oct 27 '07 #3

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

Similar topics

7
by: Wayne | last post by:
I have a script that uses filesystemobject that reads files from a given path, in my case images. It is running on a server that is 2000 adv svr w/ all current patches. The script prior to some...
11
by: Penelope Baker | last post by:
Greetings: I cannot seem to get IE 6.0 to pre-cache my rollover images. Every time the user rolls over a link, it rereads it from the server, even though it is well into the cache by that time....
2
by: Julie | last post by:
Hi, I'm trying to change images on a website without reloading the whole page and use the following code to preload the images: var preloadFlag = false; function preloadImages() { if...
3
by: Harley | last post by:
is there any way to manipulate images in vb.net in asp.net? i have a 280x280pixel jpg file, and want to display it in 2 sizes, 280x280 and 70x70... without having to create 2 files... (actually...
3
by: Simon | last post by:
This problem has been driving me mad for months.... Seen a few posts on forums about it but no answers... No mention on MSDN etc. XP Pro SP1, VS.NET (c#) .Net framework 1.1, IIS 5.1. In a...
4
by: Bernie Raffe | last post by:
When I change the 'cookieless' flag in the WebConfig file to true, everything works fine on my local PC, but the images fail to appear when using the remote server. I specify my images...
4
toxicpaint
by: toxicpaint | last post by:
Hi, can anyone give me a hand. I'm currently displaying 4 random images at the top of a page. I did this using an array of 35 pictures and then writing them to page. The problem I have is that in...
5
by: remon87 | last post by:
I need some help. I have javasript that creates the submenu but it works if I have a text with css. I need it to do the same with a roll over images. so when I click on the image the submenu...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.