Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

zoom image enhancement in javascript or css

 
f jimenez
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello guys,

i have a web application which enabled users to zoom images. these images are mostly scanned documents. now, my problem starts when images are zoomed out. documents are not readable even when images are fitted to width. is there are workaround on this?

my zooming algorithm only changes the width and height of the image accordingly. i have no idea of this can be improved so as to improve image quality. i have no idea if this can be done with css. my problem is when images are scaled down. they loose quality...

thanks a lot for any help you can give...
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CSS and JavaScript have no image capabilities. Only way you can get it to be clearer is to start out with a bigger file.

Eric
 
f jimenez
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eric Pascarello:
CSS and JavaScript have no image capabilities. Only way you can get it to be clearer is to start out with a bigger file.

Eric


thanks for the reply.

my problem is not with the enlarging of the image. our image is large. my problem is when images are shrunk. the quality of the image looses greatly. is there a way to sharpen or smoothen images in javascript or css?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by f jimenez:
is there a way to sharpen or smoothen images in javascript or css?


No. As Eric said, there is no imaging capabilities in CSS or JavaScript. All that is happening when you change the dimesnions of the image element is that the browser performs an interpolation of the image you sent to it. Apparently rather poorly in this case.

If you want control over the process you'll need to do the resizing on the server where you can employ smarter imaging tools and send the new images to the browser.
 
f jimenez
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok... then i guess this is a hopeless case. lots of changes will be made if this will be done in php... our code handling this is javascript.

thanks a lot for all your help guys...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic