Canadian Mac Forums at ehMac banner

How can I enlarge images without loosing detail and sharpness?

2.6K views 28 replies 13 participants last post by  rondini  
#1 ·
OK - to something specific....
If the image is a screen shot which on my monitor gives me an image at 72 dpi and if I then want to say double the size of the picture, it's obvious that I can't maintain the original sharpness and clarity by simply enlarging the image. Somehow pixels that didn't exist in the original image have to be generated and there is probably some sophisticated software that attempst to do this.

But the situation I need to get my head around is enlarging an image with a high resolution and still have it show clearly and sharp on the monitor.
Specifically - I have an image that is 620 x 400 pixels at 300 dpi and I want to enlarge that to 1240 x 800 pixels.
If I use preview, the picture ends up at 1240 x 800 pixels but at 300 dpi, not at 150 dpi which is what I think I want.
I don't want the software to "create" any pixels that weren't there in the first place - I think that should give me the same sharpness as the original.
Or am I way off base here?
 
#2 ·
I see you understand that computers can't invent pixels simply by enlarging or magnifying an image, but (and I don't have any experience) couldn't photo editing software apply a Blur filter to an enlarged photo thereby softening those pixels?

I'd like to hear the pros' suggestion to krs's question too.
 
#3 ·
This is an easy chore in PhotoShop or PS Elements and many other Photo applications. Simply resize image. You can set the dpi (ppi) at whatever you like then simply double one dimension from the starting point. The other will also double automatically. The detail will be the same, however since the image is double the size and quadruple the area it will appear there has been some loss.

If this is a one off thing, The GIMP is free and will do nicely, although it may not be quite as good at interpolating in those new Pixels as one of the PhotoShop or LightRoom apps.
 
#4 ·
The detail will be the same, however since the image is double the size and quadruple the area it will appear there has been some loss.
Why should there be any loss?
What I'm getting at with my original post is that the image itself had a resolution of 300dpi.
The monitor only displays 72 dpi so there are a lot of pixels that exist in the original image but which are not displayed simply because the monitor doesn't have that capability.
If I printed that image it would print every pixel (theoretically) at 300 dpi.

.... although it may not be quite as good at interpolating in those new Pixels as one of the PhotoShop or LightRoom apps.
There is nothing to interpolate if I start with a 300 dpi picture, double the widt and height and expect a resolution of 150 dpi which is still double of what a monitor can display - at least the typical one I have.

I currently use preview to enlarge the image simply because it's easy, fast and readily available.
But in the normal mode I use it. I can't control the dpi setting when I enlarge the picture. The dpi stays at the original value which means that in this case, there will be interpolation. But I really don't need or want interpolation, all these images will only be viewed on the net and any resolution higher than the typical monitor resolution is lost anyway. I have Photoshop Elements 9 and also an older version of Photoshop on a friends computer I could access, but hose applications aren't very user friendly for the casual user.
 
#6 ·
Take a look at this page.

Understanding Resolution
Thanks for the link but that article doesn't tell me anything new or adresses the issue.

It would also help if the author did some proof-reading before posting this, when he stated:

The Ins and Outs of Input and Output Resolution

If you were to now change any one of the values for Width, Height or Resolution you would simultaneously change the other two. If for example you changed the Height to 6 inches then the Width would become 4 inches and the Resolution would become 360 ppi, as seen below.
I was initially a bit confused because the width was changed to 6 inches, not the height as stated.

In any case, with preview, the resolution stays fixed at the original value so when I enlarge the image preview must "create" those additional pixels and it does affect the image quality even so theoretical, on a 72 dpi monitor, it shouldn't.

That's what I'm trying to figure out - why would the image in my original post not look at sharp and clear when enlarged if the displayed monitor dpi is way below the actual image dpi.
I need to play around with preview a bit more to see what else I can do.

If in preview I double the picture width and height by doupling the pixel width, the new image stays at the original 300 dpi resolution with "resample image" selected (which is the default.
If I deselect "resample image" which is what I think I want, the "pixel" option disappears.
So I tried using percentage and setting that at 200%.
That adjusts the dpi to 150 - great...but the final image is still the original size, it didn't change at all, only the resolution now shows 150 dpi.
I would have expected the image to be twice the size of the original - after all, that's what I chose - 200%.

Is it just that this part of preview does not work?
Or where is my misunderstanding here?
 
#7 ·
620 pixels X 300 dpi = 186,000. 1240 pixels X 150 dpi = 186,000. ;)

You're not making any change to the "physical" dimensions, that's why the image doesn't appear different on your monitor. Incidently, increasing each side by 200% is actually a 400% increase in pixels (620x400=248,000; 1240x800=992,000; 992,000/248,000=4), it varies as the inverse of the square.

There is software available which will resample (resize) to greater or lesser success, depending on the original resolution. There are stand alone versions & utilities built into existing software, such as Photoshop CS, Photoshop Elements, GIMP, and, as you've noted, Preview. All work along the same line, they use an algorithm to resample adjoining pixels and interpolate the new ones.

In order to get a larger image onscreen, you will need to keep the Resample Image toggled while you are resizing, otherwise Preview will just adjust the Resolution accordingly and there will be no size change on your screen. Bear in mind that the larger you go in size, the more pixels the software will have to interpolate & the "softer" the image will become. Some software gives better results if you use multiple steps of smaller increases, say 10%, to get where you want. PS used to be like that. Try it with Preview to see.

A final application of a sharpening filter should help your finished product to an extent.
 
#8 ·
620 pixels X 300 dpi = 186,000. 1240 pixels X 150 dpi = 186,000. ;)
When I check the picture I have enlarged using the 200% option in preview, it shows as a image of 620 pixels x 398 pixels and 150 dpi (under tools>adjust size) - it's not 1240 pixels wide as I would have expected.
The get to the 1240 pixel width, I can change the 620 pixel entry in that filed to 1240 and I will get a picture with a 1240 pixel width but at the original 300 dpi resolution which means that the software added pixels and made the image fuzzy on the 72 dpi monitor screen.

Maybe people need to try this out using preview to see exactly what is happening.
I'll post the image I'm using at the end of this thread.

You're not making any change to the "physical" dimensions, that's why the image doesn't appear different on your monitor.
Well preview thinks I'm changing the size of the picture.
The original picture shows at 2.07 x 1.33 inches, when I change the 100% to 200% and then check the size, it shows 4.13 x 2.65 inches. Again, that's in preview under Tools>adjust size.
I click OK but nothing changes as it does when I change the pixel size from 620 to 1240.
I saved the modified image but it's still the same size as the original.

Incidently, increasing each side by 200% is actually a 400% increase in pixels (620x400=248,000; 1240x800=992,000; 992,000/248,000=4), it varies as the inverse of the square.
Well yes, of course, 2x2=4, increasing each side by a factor of 2 increases the area by a factor of 4.
Still, since the original image is pretty high resolution (for a monitor) at 300 dpi, I expect to be able to increase the physical size of the image by a factor of 2 (at 150 dpi) and stll maintain the same sharpness on my screen which can only display 72 dpi's

There is software available which will resample (resize) to greater or lesser success, depending on the original resolution. There are stand alone versions & utilities built into existing software, such as Photoshop CS, Photoshop Elements, GIMP, and, as you've noted, Preview. All work along the same line, they use an algorithm to resample adjoining pixels and interpolate the new ones.
But I shouldn't need to "resample"
That's what I'm trying to get at.
The resolution of the original is way more than the monitor can display - if I double width and height, all I want is to keep a one-to-one relationship with the original pixels but now at 150 dpi rather than 300 dpi

In order to get a larger image onscreen, you will need to keep the Resample Image toggled while you are resizing, otherwise Preview will just adjust the Resolution accordingly and there will be no size change on your screen.
Sorry, what do you mean by "keep the image toggled"?

Bear in mind that the larger you go in size, the more pixels the software will have to interpolate & the "softer" the image will become.
Why would there need to be any interpolation at all.
That's exactly what I want to avoid.
Just give me the picture at twice the size and half the resolution
[/QUOTE]

This is the image I want to double in size:
Image
 
#11 ·
Hmmm ... and yawn, and with no intended offence to any reply poster who have supplied suggestions and images to use, but aren't such images supplied to some online site for a potential model railroader to view and maybe purchase the product?

And if the normal site's basic view isn't good enough for any proper detail, then just provide a link to some hi-res optional detail shot(s) for any potential purchaser to view.
 
#16 ·
There is no commercial purpose or interest related to this picture as you suggest.

It's a photograph for a Garden Railroad database where image size has been increase from 640 pixel width to 800 pixels to 1200 pixels now.
So I wanted to update the smaller size pictures with a high resolution (like 300 dpi in this case) to 1200 pixel width without loosing any of the detail and sharpness.
Any resampling of the image looses detail - that's what I want to avoid.

The database is here:
GartenBahn DatenBank

Registration is only required if someone wishes to post images and information and is free.
Anyone can use the database and several hundred thousand people have.
 
#12 ·
krs: Your monitor will only display pixels. It doesn't care about dpi or ppi which are printer/scanner terms. Your image is 620 pixels x 398 pixels, that's all there is. If you want your image larger, you will have to resample it. Period.

Here's a few links:

On 72 dpi screens.
On pixels, dpi, ppi.
More on pixels, dpi, ppi.
 
#17 · (Edited)
Let me digest what is written in the links you provided.

You seem to suggest that even when I print this photo, I will end up with a picture with only a 72dpi resolution...
That can't really be true since I have printed photographs were the resolution is much higher.

My assumption was that the file itself had a resolution of 300dpi but for the monitor only the pixels required were generated, ie 72dpi in my case.

Hmmm.....

The info in the first link and the second link seem to contradict each other.

In the first link it states:
If you see a dpi value that is NOT 72 dpi (or NOT these cases of 96 or 120 dpi as applicable), then you can trust it, that value is present in the file.
That was my understanding, but in the second link it says:
In that row also a value for dpi is given, f.e. the number 72, 180, 300 etc. This is a number without any meaning, it is an invented number!
 
#13 ·
krs, as FeXL says, you've only got 620X398 pixels. There simply are no more - what you see for "dpi" or "ppi" doesn't change that. Think of the pixels as an absolute - the dpi or ppi as something you can adjust. The adjustment will change the size and relative clarity of the PRINTED version, but it won't change the number of pixels you've got to work with unless you interpolate to add pixels, and as you've discovered, that doesn't increase the clarity of the image at all, but instead tends to degrade it. I don't know what you've been doing with it in Preview, but in Photoshop, if you look at "Image Size" it may become a little clearer. You'll see that if you uncheck "Resample Image" you can play around with any of the three figures in the document size box, but the pixels will remain constant. If you check the "Resample Image" box, then Photoshop will obediently add or subtract pixels depending on what you do - or you can increase/decrease the number of pixels, affecting the document size and the subsequent printed quality.

For images on the web, the only thing that matters when it comes to the size the image appears on the screen is the number of pixels - because what you see is what you get, unless you resize it for the web, either in a photo application like Photoshop or, if you're using WordPress (for instance) when you upload the image. Quality of the image (and number of kb/mb) is another matter - see Photoshop Save for Web Tool - How to Use the Photoshop Save for Web Tool for some info on that.

I think you've gotten yourself quite confused between print and screen versions of photos. For printing an image, you want at least 200 pixels per inch - 300 often looks better, though it depends on the printing method, the printer and the image. (Apparently the human eye cannot really see more than 200 pixels or dots per inch) This is useful to know because you can then look at a photo and divide the number of pixels in each dimension by 200 or 300 to see what your maximum printed size will be. In the photo you posted, you'd be looking at a good-sized postage stamp at 300 dpi. Because our monitors are typically 72 dpi or 96dpi or some variation (depends on the monitor these days) then you'll see something that appears much clearer and bigger than anything you'd be able to print with the same number of pixels.
 

Attachments

#18 · (Edited)
Oh oh!!! And no commercial purpose or interest implied.

But that GartenBahn DatenBank site is sure awakening my/our old model railroad habit that sort of died when our youngest son grew up and time became too short. Or some stronger interests just took over.

But he was a bit disappointed that he couldn't get to and see the MINIATUR WUNDERLAND in HAMBURG when he and his wife were working/touring Europe last year:
Miniatur Wunderland Hamburg - model building - model railway Hamburg

That sure must be something to see. ;)

Edit: PS: Personally I can't see or tell any difference between any of the posted images.
 
#19 ·
krs, I'm afraid you're still not quite getting it. You're still getting pixels (absolute) and dots per inch (variable) confused. While you can "set" dpi in a Photoshop file, it's only used when PRINTING the file - it has absolutely nothing to do with how the image will appear on screen/on the web. It doesn't even have anything to do with how it appears in Photoshop, for that matter (because you're viewing it on screen) - you can change the dpi to anything you want, but the on screen image at 100% will be exactly the same at 200 dpi as it is at 300 dpi. The dpi/ppi is entirely up to you. It's variable - the size the image is printed out will vary with the dpi. If you set the dpi to 300, then you need to divide the pixel dimensions by 300 to get the printed output image size in inches. As I noted, with the image you've got here, it would be a large postage stamp - 2.067in X 1.327. If you want the printed image larger, then you'll have to use a lower dpi - 200 or 150 etc. But again - that's the PRINTED IMAGE, which is not what I believe you're concerned with.

If you want a larger screen image, there is nothing you can do to increase the number of pixels without interpolating and degrading the image. That only happens on CSI. ;) Reducing the image size can also degrade the photo too, if you're not careful - see the link I posted about Photoshop Save for the Web if you want more info on that.
 
#20 ·
krs, I'm afraid you're still not quite getting it. You're still getting pixels (absolute) and dots per inch (variable) confused.
Paddy,
Let me go through and digest what is written in the links that were posted and in your previous reply.
Probably won't get to that until tomorrow.
But about your comments that pixels are "absolute' - if that was the case, that 620x400 pixel picture would be tiny when displayed on a Mac with a Retina display.
I don't own one of those Macs but I would think that the image size displayed on the screen would be roughly the same physical size that I see which would mean that lats of extra pixels have to be "created" or the ....well let me read up some more on this first.
 
#22 ·
I decided to experiment a little bit more before spending more time reading on this subject.

Turns out that I already had an application on my Mac that enlarges images without interpolation if that's what I was after - Seashore.
So I tried that with that ore car picture.
Turns out that the enlargement with cubic interpolation (which I assume is what preview does when it resamples) gives a better result than using "no interpolation"
Picture below - cubic interpolation on left, no interpolation on right

Image
 
#23 ·
There is no software that resamples (enlarges) without interpolation, period. There simply is no way to create data from nothing. By the look of it, Seashore just doesn't use cubic interpolation.

That said, cubic interpolation is one of many algorithms out there. Depending on the sharpness of the image, the image content, the resampling size, and whether it's an odd numbered Wednesday, one algorithm may perform slightly better than another.

We've used PhotoZoom in the past & you can try a few different algorithms for best results. They had what they called an "S-Spline" algorithm that was usually superior to bicubic interpolation (which is what PS and others used). PS version has improved since then and is what we mostly use now.

Your resampled image may improve with a bit of sharpening.
 
#26 ·
There is no software that resamples (enlarges) without interpolation, period. There simply is no way to create data from nothing. By the look of it, Seashore just doesn't use cubic interpolation.
I didn't expect data to be created from nothing.
The "300dpi" info on the original image suggested that there was additional pixel data that just wasn't used with the 640x400 pixel image because it was not needed since a monitor wouldn't display it anyway..

And why do yu say that Seashore doesn't use cubic interpolation?
Seashore shows three options:
No interpolation
Linear interpolation (which I haven't tried)
Cubic interpolation
Seashore being an image manipulation program should know what they are talking about - that at least is my expectation.
 
#24 ·
This thread makes me think of all those crime dramas on TV where the hero spots some smudge in the corner of a crappy, low-resolution, surveillance camera frame. He barks: "Zoom in and enhance that!" Magically, they produce a magazine-quality portrait of the bad guy. Yeah, right.

Same principle here. The original image has 400 rows with 640 pixels on each (256,000 pixels). If you want 1280 by 800 (1,024,000 pixels), three-quarters of the pixels have to be made up. [Doubling the height AND the width means you need 4 times as many pixels.] Different algorithms just use different approaches to inventing the pixels that weren't there originally.

Craig
 
#25 ·
Same principle here. The original image has 400 rows with 640 pixels on each (256,000 pixels). If you want 1280 by 800 (1,024,000 pixels), three-quarters of the pixels have to be made up. [Doubling the height AND the width means you need 4 times as many pixels.] Different algorithms just use different approaches to inventing the pixels that weren't there originally.
Guys (and gals) - I understand all that.
If the original image had shown 72dpi or some number around that value, the whole question would not even have come up.
But the original image showed 300dpi and also based what was written in one of these supposedly "expert" links that were posted, -
If you see a dpi value that is NOT 72 dpi (or NOT these cases of 96 or 120 dpi as applicable), then you can trust it, that value is present in the file.
the file itself should have pixels that were just not displayed on a regular monitor with the 640x400 pixel image. That's were the "300dpi" shown in the original file is confusing as heck.

Let's turn the situation around - if I start with a 1280x800 pixel image and reduce that to 640x400 pixels - are the pixels not required to display that new 640x400 pixel image on a standard monitor just thrown away?
I thought they would be kept as part of the image file itself but only 640x400 pixels would be displayed on the monitor.
But it sounds as if those pixels are just thrown away - period.


Btw - Question never answered - what happens if you display this image on a "retina" screen - it surely wouldn't just show ar 640x400 pixels on that screen which would make the picture rather tiny.
 
#29 ·
I liked how the OP chirped the original article for the writing, and yet his original post talked about 'loosing' detail.