I've got a couple of old photographs that I'd like to digitally enlarge. I was wondering if anyone knows of any good techniques or software that will let me enlarge the image while keeping it (relatively) free of blur. I'm not looking for a major size increase.
I've got Photoshop and that usually does a nice job, but I just wanted to ask about any special software you guys may know about.
I think there's no way to scale an image without blurring it.
Configurate Photoshop to use bicubic filtering and then scale it.
I don't see other options. (All the image manupulation software I know has linear and bicubic filtering.)
There are some programs out there which can use several routines to enlarge images. Although I don't think there is one magic routine here..
Try searching for Lanczos.
I thought they had pills for that
Haha, I knew this would someday be useful: http://www.cambridgeincolour.com/tutorials/digital-photo-enlargement.htm
There's specialized software available for specifically for enlarging photographs that does a very good job. According to the above linked page "GenuineFractals" is the best one. Bicubic and Lanczos and similar are general purpose algorithms that do reasonably well for all types of images but aren't really that good for any one particular type.
I thought they had pills for that
They Do! I was running for the toilet every 5 minutes all day and night it was terrible
Just use allegro and stretch_blit it, or use a vector approach and blit it point/point onto a new bitmap.
It is just a few code lines.
example: EDIT: TESTED and working OK
1 | #include <allegro.h> |
2 | |
3 | BITMAP *loaded, *new_one; |
4 | |
5 | int W=0,H=0, /* new_one bitmap size */ |
6 | x=0,y=0; /* iterators */ |
7 | |
8 | char new_name[512]; |
9 | |
10 | int main( int argc , char *argv[] ){ |
11 | |
12 | if( argc < 2 ) |
13 | return -1; /* no parameter */ |
14 | |
15 | set_color_depth( 32 ); |
16 | |
17 | allegro_init(); |
18 | |
19 | loaded = load_bitmap( argv[1] , NULL ); |
20 | |
21 | if( !loaded ) |
22 | return -1; /* invalid filename or corrupted bitmap */ |
23 | |
24 | printf( "\nX Size is: %d , Enter new X size:" , loaded -> w ); |
25 | |
26 | scanf( "%d" , &W ); |
27 | |
28 | printf( "\nY Size is: %d , Enter new Y size:" , loaded -> h ); |
29 | |
30 | |
31 | scanf( "%d" , &H ); |
32 | |
33 | if( W <= 0 || H <= 0 ) |
34 | return -1; /* out of range values */ |
35 | |
36 | new_one = create_bitmap( W , H ); |
37 | |
38 | if( !new_one ) |
39 | return -1; /* error creating */ |
40 | |
41 | clear( new_one ); |
42 | |
43 | for( x = 0 ; x < W ; x ++ ){ |
44 | for( y = 0 ; y < H ; y ++ ){ |
45 | putpixel( new_one , x , y , getpixel( loaded , (x * loaded -> w ) / W , (y * loaded -> h) / H ) ); |
46 | } |
47 | } |
48 | |
49 | sprintf( new_name , "new_%s" , argv[1] ); |
50 | |
51 | save_bmp( new_name , new_one , NULL ); |
52 | |
53 | destroy_bitmap( new_one ); |
54 | destroy_bitmap( loaded ); |
55 | |
56 | allegro_exit(); |
57 | |
58 | }END_OF_MAIN(); |
Attached is a windows binary.
Usage is: test.exe name_of_bitmap_to_modify.bmp
After what you enter the new X and Y size and it will save your bitmap.
It just quit if any error occur.
EDIT2: Do not use it with /path/bitmap_name.bmp, because in this case it will try to save it under new_/path/bitmap_name.bmp.
_
Gulldrididi: Did you read the page I posted a link to? There are so many methods that are infinitely better than simple scaling, that your post isn't even funny anymore...
For once.. (sigh).. I have to agree with Miran.
The OP was wanting to keep his picture free of blur. It's done by the way I gave. My post was not made to be funny. And please spell my name correctly, or just call me Gull
And yeah, I have already read the whole link you gave before posting. As I said, I just give my way because of the need of non-blurred picture. If he have a sprite to enlarge and if he do not want a pink halo around it, he should not use any interpolation.
Finally, I was thinking that posting a few line of code can not be that bad.
M.Phipps, are you sure that you are not agreeing just for the sake of it ? hum hum.
_
Sorry for not knowing how to spell your name, but it's just so nonsensical...
And yeah, I have already read the whole link you gave before posting. As I said, I just give my way because of the need of non-blurred picture.
But did you look at the sample pictures? There's a direct comparison between your method and several others (you need to hover the mouse over the links so the pictures update!) The specialized fractal/vector algorithms do not produce blur and look by far better than the pixelized look of simple scaling.
If he have a sprite to enlarge and if he do not want a pink halo around it, he should not use any interpolation.
He has a few old photographs And if he did want to enlarge sprites, the other methods are still better. Just look at that breakout game Phipps made a while ago...
Finally, I was thinking that posting a few line of code can not be that bad.
This is certainly a good thing.
Now, it is a classified story/case ;-)
Simple pixel resize looks horrible unless the output size is an exact multiple (i.e. x2, x3, x4). Even then it doesn't look good for photographs.
Using some bilinear or bicubic interpolation when enlarging shouldn't be called blurring, even though the result looks kind of blurred, compared to nearest neighbour methods (allegro stretch_blit()). Blurring is what you add to a picture, when you don't change the seize. And when you blur, you lose information, when you just want to smoothen some sharp details. You may use stretch_blit() and then you may blur, but you might not end up in same result.
Take a 1024*768 image (digital photo) and scale it down to 256*192. Then make one copy that you scale back to 1024*768 using some bicubic interpolation. Make another copy using "non blurring" stretch_blit(). The former is definitely more near the original. That's why it is stupid to talk about blurring when upscaling using bicubic interpolation.
If your old photograps are on photo paper, use the best scanner you can get. Hopefully you can turn the whole issue into a downscaling issue. If they are digital images, you have to stick with the stuff on the page Miran linked to.