wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes zoom image enhancement in javascript or css Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "zoom image enhancement in javascript or css" Watch "zoom image enhancement in javascript or css" New topic
Author

zoom image enhancement in javascript or css

f jimenez
Ranch Hand

Joined: Mar 14, 2007
Posts: 30
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...


if you can't be the sun, be a star...<br />もし たいように なれないたら ほしに なれ。
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Mar 14, 2007
Posts: 30
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

Joined: Jan 10, 2002
Posts: 61103
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
f jimenez
Ranch Hand

Joined: Mar 14, 2007
Posts: 30
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...
 
Don't get me started about those stupid light bulbs.
 
subject: zoom image enhancement in javascript or css