• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

zoom image enhancement in javascript or css

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
I'm all tasted up for a BLT! This tiny ad wants a monte cristo!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic