Screenshot smoothening

Page 3/3
1 | 2 |

By [D-Tail]

Ascended (8233)

[D-Tail]'s picture

23-06-2004, 21:01

Yup, I had that algorythm before, but the results weren't as satisfactory as the current one.

By the way, Sousuke: your algorithm's about 8 times as fast as mine, indeed. As said, I didn't care for optimization when I made it. But I didn't think such a simple block of code would cause such a huge amount of stress Smile. Anyway, instead of 1'20" it takes 10"-20" as execution time. Still too much I guess... Maybe I should try to install that ImageMagick properly...

By Sousuke

Master (177)

Sousuke's picture

25-06-2004, 20:12

Anyway, instead of 1'20" it takes 10"-20" as execution time. Still too much I guess... Maybe I should try to install that ImageMagick properly...Yup, it's still too long. And additionally that image has to be filtered each time, when the page is opened! Shocked! I wonder how long ImageMagick will take for that Smile

Another idea: Why don't you convert each new image only once, and save it's result somewhere on the HDD. If that image is needed again, then grab the converted one.

Should be a little bit faster this way Wink

By [D-Tail]

Ascended (8233)

[D-Tail]'s picture

26-06-2004, 10:33

Anyway, instead of 1'20" it takes 10"-20" as execution time. Still too much I guess... Maybe I should try to install that ImageMagick properly...Yup, it's still too long. And additionally that image has to be filtered each time, when the page is opened! Shocked! I wonder how long ImageMagick will take for that Smile

Another idea: Why don't you convert each new image only once, and save it's result somewhere on the HDD. If that image is needed again, then grab the converted one.

Should be a little bit faster this way Wink
Yes, I'd agree with the latter Smile, but it can also be loaded just once, and save it for, let's say, 20 minutes in the browser's cache. Shouldn't be a real hassle.

By ro

Guardian (4123)

ro's picture

26-06-2004, 16:16

on the other hand, WHY would you have a original MSX screenshot ani-aliased anyway? isn't this some sort of masking/tricking to make it look better while in fact it's a trick. Dunno your reason but why?

I've done a realtime PHP screen5 picture loader myself (see www.thefuzz.nl and check download/screenshots for proof) and I myself was indeed surprised too about the slow PHP process! (about 5 to 10 secs to load up a screen, depending on brightness and dimension settings) Yeah, I build in a scaler and brightness button to get closer to original format

If you want antialiassed pictures you also might wanna use photoshop and use some blur or anything (in combination with the automation function)

cheers. ro

By [D-Tail]

Ascended (8233)

[D-Tail]'s picture

27-06-2004, 03:00

Well ro, a MSX picture would surely look fine on a (MSX!) screen, so, when you wanna stretch it to sizes acceptable on 17" monitors (most likely, it's the most standard monitor size these days), you would surely want to antialias it. And besides, PC monitors (VGA monitors, to be exact) are too sharp to give images that blurry look that MSX monitors give them. So, as a kind of substitute, I offered this crappy anti-alias algorythm.

So that's why Wink

By [D-Tail]

Ascended (8233)

[D-Tail]'s picture

27-06-2004, 03:01

By the way, ro, those images are great! Tongue

By ro

Guardian (4123)

ro's picture

27-06-2004, 12:15

Yeah, I understand a VGA (specially with streched images) makes an a MSX screen look very blocky (too sharp) but your blurry algo makes it more than UN-sharp (too blurry), also the scaler function in some emulater (blue?) fuckes up the original in a way which I hate.

There should be some compensation in the blurry algo routs to make ik blocky, but not too sharp.

By ro

Guardian (4123)

ro's picture

27-06-2004, 12:51

another thing; making it a truecolor image (since your blur routine (anti alias) is using true colors) will help slowdown the process. Not to mention the file size!!
(which, in its turn, will slowdown the image download)

using PNG will enable you to use indexed colors. You could make the algo so that only about 16 EXTRA colors can be used to blur the image (ending up with a 32 indexed color portable network graphic image) or anything like that.
it will speed up your script too cuz colors are pre alocated for example

I've checked my own php GE5_viewer again, but I can't say I hate them outcoming pics (read: sharpness) . . I Like it ! (retro baby, retro)

Well, hopefully you end up having some compromised neat blurry algo which will be very usefull at the end. Keep us informed D-t!

By [D-Tail]

Ascended (8233)

[D-Tail]'s picture

27-06-2004, 17:31

erm... Well, I don't know all the exact [D-Tail]s of the .PNG fileformat. The PHP/GD manual recommends creating true color images using imagecreatetruecolor() over creating normal images using imagecreate(). But as Sousuke already stated, it's the imagecolorallocate() which messes up the algorythm's speed. I don't know any specific PHP/GD .PNG-related issues, for in PHP you just create an image. In the end you decide which format will be output, using imagepng($image) or imagexbm($image) or so. So I think PHP/GD will optimize the picture for the fileformat itself.

Page 3/3
1 | 2 |