shane18 Posted June 10, 2010 Share Posted June 10, 2010 I noticed if I have Firefox scale a 500x500 image to 40x40 it looks shitty.... but if i re size the image to 50x50 then have firefox scale it to 40x40 or 22x22 it looks sharp... why? Quote Link to comment https://forums.phpfreaks.com/topic/204442-resizing-scaling-question/ Share on other sites More sharing options...
haku Posted June 11, 2010 Share Posted June 11, 2010 Browsers aren't made to resize photos. They are made to display photos at their actual size. Why are you using using images larger than they need to be displayed? It's just going to slow down your page loads. Quote Link to comment https://forums.phpfreaks.com/topic/204442-resizing-scaling-question/#findComment-1070783 Share on other sites More sharing options...
shane18 Posted June 16, 2010 Author Share Posted June 16, 2010 Well, I'm not anymore... i was just wondering why scaling a image makes it look SHITTY, when if u resize a image it looks crystal clear... what makes scaling different from resizing? Quote Link to comment https://forums.phpfreaks.com/topic/204442-resizing-scaling-question/#findComment-1072823 Share on other sites More sharing options...
haku Posted June 16, 2010 Share Posted June 16, 2010 Browsers aren't made to resize photos. They are made to display photos at their actual size. I'm guessing you are using photo editing software to re-size the image. Photo editing software is made to resize images. Browsers aren't. Simple as that really. Quote Link to comment https://forums.phpfreaks.com/topic/204442-resizing-scaling-question/#findComment-1072856 Share on other sites More sharing options...
shane18 Posted June 17, 2010 Author Share Posted June 17, 2010 well isnt scaling and resizing an image different in general? i heard if u scale a image to a smaller size, it will have less quality then if u resize the image to a smaller size... isn't scaling just a simpler and faster way to resize something? is that why the image quality is worst? does resize do way more steps to insure quality while scaling does just enough to get it done? is that what causes the quality difference? don't the terms "scaled to" and "resized to" mean different things? Quote Link to comment https://forums.phpfreaks.com/topic/204442-resizing-scaling-question/#findComment-1073229 Share on other sites More sharing options...
haku Posted June 17, 2010 Share Posted June 17, 2010 Lets say you have an image that is 200px by 200px. In your css, you set the image to: height:100px; width:100px; You have scaled the image to 100px by 100px. Then you open the image up in photoshop (or some other image editing program) and you re-size the image so that at it's full size, it is now 100px by 100px. You put the image on your site, and in your css you set: height:100px; width:100px; You have resized the image to 100px by 100px. In the first case, you are forcing the browser to show the image at a different size that the actual image exists at. Browsers are not image editing programs, and therefore it may not look nice. Besides the fact that you are forcing the user to download more data than they need, since the image is four times the size of the image they need, browsers have to use whatever algorithms they have to show the image at the size you have forced it to be. Browsers aren't made to do this well, and to make them do it well would require a heavier browser, which is pointless since images should be uploaded at the size at which they are to be displayed. Quote Link to comment https://forums.phpfreaks.com/topic/204442-resizing-scaling-question/#findComment-1073235 Share on other sites More sharing options...
gizmola Posted June 17, 2010 Share Posted June 17, 2010 At the end of the day, they are one in the same. There are different algorithms for taking a large image and shrinking it. The result is highly dependent on the nature of the original. Photoshop provides "resampling" with several different algorithms available when you want to increase or decrease the size of an image. For photos (bitmap) images, the standard technique used in photoshop is called "bicubic" which implements a complex sampling algorithm, however, you can dumb it down to the types of techniques used by browsers, via the "nearest neighbor" or "bilinear" algorithms which basically just look at neighboring pixels. Chances are the browsers are simply implementing a nearest neighbor algorithm which is why the downsampled images look bad. Quote Link to comment https://forums.phpfreaks.com/topic/204442-resizing-scaling-question/#findComment-1073238 Share on other sites More sharing options...
shane18 Posted June 18, 2010 Author Share Posted June 18, 2010 thanks for clearing that up Quote Link to comment https://forums.phpfreaks.com/topic/204442-resizing-scaling-question/#findComment-1074181 Share on other sites More sharing options...
shane18 Posted July 1, 2010 Author Share Posted July 1, 2010 I just found something that I think I should add... the browser re sizes images perfectly... the php code i used to crop the image was set at default quality of 75%... so the image looked crappy regardless.. so this post was all over a mistake.. there really was no problem WOOT! Quote Link to comment https://forums.phpfreaks.com/topic/204442-resizing-scaling-question/#findComment-1079571 Share on other sites More sharing options...
haku Posted July 1, 2010 Share Posted July 1, 2010 Now it all makes sense. It wasn't very clear for two reasons: 1) You didn't actually say that you had a problem. You just seemed to be asking a question. 2) You left out that huge bit of information that you were using a PHP resizing script. It sounds like you weren't even scaling with the browser at all - your server was resizing the images. If you had have done done number one and mentioned number two, your problem could have been resolved a lot less painfully. Quote Link to comment https://forums.phpfreaks.com/topic/204442-resizing-scaling-question/#findComment-1079585 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.