Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Developing Image Filters

    I'm basically wondering how to program specific filters for images. I work heavily in remote sensing and would to develop a few simple tools in a web application to alter images. I'm not looking for specific lines of code, rather just direction. Thank you

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,474
    Thanks
    6
    Thanked 980 Times in 953 Posts
    You can’t add filters to images with JavaScript because that would rely on the browsers supporting them which they aren’t currently. This needs to be done with a server-side script and an image library, I suppose, to generate the images and then send them to the client.

  • #3
    Regular Coder
    Join Date
    Jan 2013
    Location
    Germany
    Posts
    578
    Thanks
    4
    Thanked 77 Times in 77 Posts
    Not images directly, but using HTML5 you can manipulate them with Javascript through the canvas element, for example. A sample library is here: http://fabricjs.com/image-filters/

    Some vendors support image filters with CSS, too – for example http://www.hongkiat.com/blog/css-filter/.

    You'll find plenty resources on the web.

  • #4
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,184
    Thanks
    10
    Thanked 569 Times in 550 Posts
    Quote Originally Posted by VIPStephan View Post
    You can’t add filters to images with JavaScript because that would rely on the browsers supporting them which they aren’t currently. This needs to be done with a server-side script and an image library, I suppose, to generate the images and then send them to the client.
    the image editor i wrote 5 years ago can do many filters; edges detection, gray conversions, sharpening, etc. it's basic math, which i assure javascript is more than capable of. CSS filters are fast, but they don't modify the file, so if you were wanting to save the transformed image, you have to use canvas to generate a png or jpeg.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •