I have a question about the relationship between the image width x height and file size. The image editor software usually resize an image by width x height such as 80 x 75 and so on. How shall I know the final file size after I selected the width and height? Is there any relationship between the width, height and final file size after compression?
+ Reply to Thread
Results 1 to 8 of 8
-
-
There's really no way to know for sure because formats use different compression algorithms, the only one that is close to being linear is Windows Bitmap(BMP). JPEG for instance samples the photo and if it has little color or gradients it will have a small file size after compressing.
-
For uncompressed images the relationship is simple:
width * height * bytes per pixel + a little overhead for the container
For compressed images there is no simple relationship except larger frames tend to make larger files. But the amount of detail and noise in the image, and the settings used in the codec, can make a big difference. For example here are pair of PNG images:
Both are lossless PNG images. The first is 352x288 pixels and the file size is 287 KB. The second is 1920x1080 but the PNG file is only 80 KB.Last edited by jagabo; 11th Aug 2011 at 16:10.
-
Hi, jacoho! You gave an example and said “The first is 352x288 pixels and the file size is 287 KB. The second is 1920x1080 but the PNG file is only 80 KB.”
When you selected the image size such as 352x288 pixels, you did not know the final file size 287KB until you actually saved the file, right?
The hosting site always has the file size limits for the uploading. So I have to resize an image or compress video file to meet its file size limits. Does anyone have a good idea to know or estimate the file size before saving it or it is impossible to know the final file size until you actually save it? Right now, if the final file size is too large, I have to resize the image smaller and then save it to see whether it meets the file size limits. It is timing consuming and I have to test it several times. I really want to know the file size before save it so that I can control it. -
Well, the program I used said what the file size would be before it actually saved it. But before I started saving I had no idea what the file size would be (I knew it would be large because of the noise, and the other file would be smaller because there was no noise and little detail).
For video it's easy:
size = bitrate * running time
For images all I can recommend is using a lossy codec like JPEG. Generally, for a given image, the more you reduce the frame size the smaller the final file will be. -
Jagabo, what program do you use to resize/edit the image or video that can tell you the file size before you save it, by the way?
-
-
Photoshop's Save for Web option shows you the file size when you slecet a compression level. Find the right the compromise between quality and size, then save. Save For Web does jpg, gif and png.
For video you can use any good bitrate calculator (I like Vcalc as a standalone tool). This is independent of your encoder.Read my blog here.
Similar Threads
-
how to check width and height of a mov file
By moniia in forum Newbie / General discussionsReplies: 4Last Post: 31st Jan 2011, 14:19 -
Mencoder Maximum Height/Width
By andrewbutkus in forum Video ConversionReplies: 2Last Post: 8th Oct 2010, 09:02 -
mp4 width/height problem
By jfish666 in forum ffmpegX general discussionReplies: 1Last Post: 9th May 2009, 05:36 -
Changing width & height
By Blå_Mocka in forum Newbie / General discussionsReplies: 2Last Post: 31st May 2008, 11:27 -
How to-adjust video frame height and width
By tvlreject in forum EditingReplies: 1Last Post: 9th Jul 2007, 02:36