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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jun 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    One of the hardest challenge i dealed with- Change color of certain part of an image

    So.. till now i havent found someone who solved this. i need this for extreme important project-
    lets say i have jpg/png image. im trying to achieve that - when ill press a button, it will trigger a function , that will randomaly change the color of 1 pixel(for example) of the img.NOT THE SCREEN PIXEL, it need to change the pixel color of the img.
    I JUST COULDNT FIND EVER START IN THE NET.. this is just too dam hard..i will even pay if someone will find a way.. thank you hopefully this forum will answer me because no one else did yet.. :\

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Not possible unless you have to change it to another image src with the changed pixel. The browser is not Photoshop that it could literally edit the image on the fly.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,981
    Thanks
    56
    Thanked 557 Times in 554 Posts
    I would think that working with <canvas> this wouldn't be so difficult. W3schools even has a tutorial on it, and I guess there are many more...

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Fairly easy to do using canvas. I have a tutorial at Canvas - Modifying Images that shows how you can modify all of the pixels in an image using a loop. To change just one pixel you wouldn't need the loop.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #5
    Regular Coder
    Join Date
    May 2012
    Location
    France
    Posts
    224
    Thanks
    0
    Thanked 32 Times in 30 Posts
    See for example this page Create a Drawing App with HTML5 Canvas and JavaScript.
    Load only your image and use putimageData and getimageData...
    Last edited by 007julien; 06-22-2014 at 11:46 AM.


  •  

    Tags for this Thread

    Posting Permissions

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