aMSN Forums
May 24, 2013, 01:17:36 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Slow image handling  (Read 13721 times)
FdB
Power user
*
Offline Offline

Posts: 99



View Profile
« on: June 17, 2006, 02:00:14 am »

First of all, I'm sorry for my bad English, it's been a while since I wrote English. My issue happens whenever aMSN (I have the latest SVN release, I update daily, right now I have revision 6906) tries to handle an image, it just freezes, not allowing me to do anything (only aMSN freezes, Windows keeps working fine). This is really anoying because it takes from 10 to 15 seconds, according to image size, and it won't let me reply to chat windows. It happens when I open the "Display Pictures browser" (for it has to open all the personal images in the disk), even tough this is the fastest of the freezes... The really slow freezes happen when I browser for an image, and after I've selected it, aMSN freezes for 10 to 15 seconds, and after that it asks me for which size I want the image (default, huge, small, etc..), and it freezes again for 10 seconds or so... and it also freezes when I try to send a file, as it resizes the image to show in the chat window. Is this just me, or is it a known issue? I don't think the problem is the computer as I have a Pentium IV 2Ghz, 512RAM... It only happens when resizing images... Sorry about the long text and the bad English. By the way... aMSN is SO great!!! Smiley Smiley thank tou guys for every second and every line of code!! It's worth it Smiley
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #1 on: June 17, 2006, 06:50:09 am »

Hi there,
first, your english looks perfect to me, so don't worry Smiley
about image handling being slow, this is weird.. I mean, yes, we do know that the image handling is slow, but not THAT much... I must admit that the picture browser is for sure something you can't really depend on because it WILL be slow.. depending on how many pictures you have... I personally have around 2500 cached DPs, so I never enable the 'show cached images' option.. if I do, it will freeze for ALOT of time until it completly shuts down with an 'not enough memory' error...  
but with the DP browser without cached images, it takes maybe 1 second to load, nothing major...
sending a file does take some time but I don't think amsn freezes during that time.. I might be wrong...
anyways, I'll let other people report here to see if they have the same issue...
Logged

KaKaRoTo
woekele
Power user
*
Offline Offline

Posts: 56


View Profile
« Reply #2 on: June 17, 2006, 04:26:58 pm »

Big pictures for me also take very long and amsn is freezed for a long time. With normal MSN it goes just quickly, so it should be possible.
Logged
FdB
Power user
*
Offline Offline

Posts: 99



View Profile
« Reply #3 on: June 19, 2006, 12:11:53 pm »

I had about 30 personal images in my dp browser (no way I was going to enable showing cached dp Tongue) and it took a little to load (2 / 3 seconds), but that's not where the freezing is... It's when I add an image, because amsn has to resize it to a smaller image and that's when amsn freezes... my pictures are 90% of the times 1632x1224 sized... and when I say file transfers are slow, it's not the actual file transfer, it's when I tranfer an image, because once again amsn resizes it to send the preview... And once again I can't tell how glad I am there is aMSN Smiley Smiley thank you all. (Oh and thank you for the compliment kakaroto, you'r English is also perfect to me Tongue Tongue)
Logged
vivia
Administrator
Super Power User
*****
Offline Offline

Posts: 2464


View Profile
« Reply #4 on: June 19, 2006, 12:39:00 pm »

FdB : yes, TkCximage (the part of amsn that handles images) is very slow, a rewrite is currently in progress (what's the status Phil? will you resume working on it this summer?) Anyway, it shouldn't be THAT slow... Maybe because your images are so big? Try resizing them with another software if it bothers you that much... sorry :S
Logged
FdB
Power user
*
Offline Offline

Posts: 99



View Profile
« Reply #5 on: June 19, 2006, 01:28:42 pm »

Quote from: "vivia"
(...) Anyway, it shouldn't be THAT slow... Maybe because your images are so big? Try resizing them with another software if it bothers you that much... sorry :S


No problem at all, I figured that I would have to do that, if I resize them to 96x96 it works nice, but it's stilll anoying when I want to send those big images (it takes like 10 seconds, and freezes every other chat window, so people start Nudging and asking "Hey, you there?", so it's kinda anoying :S), so maybe you could add an option not to send image previews (I used to use the "Old file sending" or whatever it was called, but it's not available anymore (I'm using latest SVN)). Oh btw, is it normal that the forum isn't sending me an e-mail when a reply is posted? My e-mail address is correct, I've checked it and I've checked the send me notifications and even checked "Notify me when a reply is posted" :| anyways, thanks you for the time, and keep up the good, great, amasing (...) work (yeah, I really love aMSN Wink Wink
Logged
vivia
Administrator
Super Power User
*****
Offline Offline

Posts: 2464


View Profile
« Reply #6 on: June 19, 2006, 04:17:18 pm »

About not sending email: unforunately it's normal, yeah, due to sourceforge hosting.. I'll see what we can do about the option to disable preview. (As a workaround, try compressing the images before you send them)
.... They start nudging you after 10 SECONDS of inactivity?? They're too impatient... Cheesy
Logged
FdB
Power user
*
Offline Offline

Posts: 99



View Profile
« Reply #7 on: June 19, 2006, 11:01:31 pm »

Quote from: "vivia"
.... They start nudging you after 10 SECONDS of inactivity?? They're too impatient... Cheesy


Alright, they are, but it's because it doesn't take 10 seconds, it was just a (wrong) prediction Tongue I just stopwatched aMSN, and since the selection of a picture (in Display Pictures -> Browse) to the little window with size choice (small, default, huge, original ...), it was 41.6 seconds (say, 41seconds) and then I press Ok in that form (I choose Default size) and it takes the exact same time to return to Display Pictures... needless to say aMSN completely freezes during these 82seconds... so, my contacts are not impatient Tongue Tongue oh and the same time happens when sending a file, so I figure it's all from the same source: image resizing...
Logged
vivia
Administrator
Super Power User
*****
Offline Offline

Posts: 2464


View Profile
« Reply #8 on: June 20, 2006, 01:32:57 pm »

Hmm, OK, I suggest you stick to sending compressed images instead and resizing them outside aMSN for now, until the TkCximage rewrite is done... Sorry...
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #9 on: June 20, 2006, 04:08:59 pm »

that is one huge issue.. it's weird I never noticed it. maybe I'm not too much into resizing/sending, etc... humm... vivia, you think it's caused by that bicubic whatever algorithm used by resizing ? should we change it back to linear (fastest) ?
c.f. http://amsn.sourceforge.net/forums/viewtopic.php?t=189&highlight=bicubic
maybe have a 'ratio', if we resize from 100x100 to 96x96, then use bicubic, if from 1600x1200 to 16x16... use linear... or something.. we'd have to find the best way to make it keep good image quality but still stay fast enough...
I'm sure it's caused by this algorithm (which is the slowest but keeps the best quality)...
You know what, we could just get it back to the faster algo and get away with it... if you look at that thread, the only person who requested that, it was because there was a 'quality loss' when resizing, but that quality loss is undetectable to MY eye, only this 'eviltwin' was able to see it (and be bothered by it). Also, look at my last post (:$), he pissed me off, so why keep something that degrades amsn only to give a favor to someone like him...
also, read this : http://www.xdp.it/cximage/doc/doxy/html/group___transformations.html#ga3
we now use bicubic, I don't know if we used the nearest pixel method before, so if yes, we might want to use bilinear (slower but more accurate than nearest pixel, and faster but less accurate than bicubic (current algorithm) )
Also, note that it says it's slowest on 8bpp (gifs for example are all 8bpp)... The ReSample2 function is also a good idea to try out, maybe it's a lot faster... it says it uses new algorithms and doesn't say if it slow on this or fast on that... so maybe it's optimized (+ keeps alpha blending)

humm.. I just looked as svn (svn blame is wonderfull!! Cheesy) and I can see that we used nearest pixel before for the resampling, I can also see that we still use it now for resizing animated gif images (but bicubic for for normal images)... vivia, look at the diff in revisions : 5748.
Code:

image.Resample(width, height);

became (for bicubic spline interpolation) :
Code:

image.Resample(width, height, 2);

and we should now either revert it (for nearest pixel algorithm) or make it :
Code:

image.Resample(width, height, 1);

for using the bilinear algorithm... so it's really easy to do, so vivia, don't say "I can't do it, I don't know how to do that!!!" :-p
As you can see, it's really easy, which is why I said we should keep using CxImage, and not try to reimplement all that from scratch.. we should optimize CxImage instead of rewriting, it would really be stupid to trash all that code and simplicity).
Fdb, woekele, if you know how to compile on windows, then do these changes, play with the different algorithms, try using the Resample2 method, and see how much it improves.. try to judge oon a good solution (Resample vs. Resample2 and which algorithm to use) that would be fast enough but will not make us loose too many of the quality.
Thanks.
Logged

KaKaRoTo
NoWhereMan
Contributor
Super Power User
**
Offline Offline

Posts: 502



View Profile
« Reply #10 on: June 20, 2006, 06:23:10 pm »

I'd suggest linear to scale down pictures and bicubic/bilinear only to scale up. You shouldn't need details in a thumbnail, while scaling up always needs antialiasing.
As aMSN graphics operations are always to scale down, I'd use linear as a default.
Logged

NoWhereMan
-- Windows mom: «Finish your veggies! There are processes in Ubuntu that are starving to death!»
-- NoWhereBlog (ita)
-- http://flatpress.sf.net
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #11 on: June 20, 2006, 06:34:12 pm »

nowhereman : you might be right, but we'd need the faster algo (nearest pixel) for thumbnail of a file transfer preview, but for resizing a display picture, maybe the bilinear/bicubic would be best to avoid having 'crappy' DPs...
Logged

KaKaRoTo
NoWhereMan
Contributor
Super Power User
**
Offline Offline

Posts: 502



View Profile
« Reply #12 on: June 20, 2006, 06:56:35 pm »

I mean that in my experience the scaling down a picture using linear or even the quick/normal algorithm (try yourself in the GIMP) gives acceptable results.
Moreover, on windows, if you try irfanview, using bicubic to scale down an image will give you a blurred result  Wink (but this could be just a bad implementation)

bye
Logged

NoWhereMan
-- Windows mom: «Finish your veggies! There are processes in Ubuntu that are starving to death!»
-- NoWhereBlog (ita)
-- http://flatpress.sf.net
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #13 on: June 20, 2006, 08:14:48 pm »

we always scale down, and yes, it does give a little bit blurry image, so it's slow with that method even if it's scaling down... the problem is when you resize a big image (1024pixels + ), that's when it takes a lot of time.
Logged

KaKaRoTo
FdB
Power user
*
Offline Offline

Posts: 99



View Profile
« Reply #14 on: June 22, 2006, 12:24:26 am »

I can't tell how proud I am that a topic I thought was nothing special, became something so popular Tongue Tongue pity the forum isn't sending emails so I jave to come back every now and then... As for the windows compiling, I have no idea how to do it.. in linux yeap it's easy, but in crappy windows, it doesn't know that ./configure && make && make install is Tongue lol so I'll just go by you'r judgement... Oh I have an Idea (just had it, really Tongue):

How about in that form of the DP size (original, small, default....) you add an option just like the GIMP does, like for the method of resizing (linear(fast)/bilinear(best))... thus user would be to blame for long time... oh an a little progress bar, and trying to avoid aMSN to freeze would be so great... for sending images I guess linear would be the best, since it's just a damm preview (I don't like those, it takes the fun of a full sized image (I exgange some..."interesting" images with girl friends Tongue Tongue lolol)). So i'd still go for the Option to disable image previews, and add that little extra in the display picture size selection form... (by the way, aMSN also freezes 40second BEFORE that form shows up, so i belive he's doing the same thing twice...). And kakaroto, thank you for you interest, it really made me feel glad Tongue aMSN rulles the most...

(By the way, as I'm writing, I'd like a feature request Tongue it was possible but you guys disbled it :S --> Offline Chatting... I know it was possible to chat to contacts even if we where Appear Offline, but now aMSN checks for that, and it's really bad, 'cuz when I want to talk only to ONE person, i'd rather stay offline and chat only to that person... I remember it was possible and a friend of mine just told it is possible in that messenger live 8 or whatever that it...) and for a fact, i played with that ML8 for a while and it made me sick to see how FAR behind they are... thank God (and kakaroto and Alvaro and everyone at the credits Tongue) aMSN exists!!! Smiley Keep up the WONDERFUL work!!
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!