Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8947755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:50:54+00:00 2026-06-15T12:50:54+00:00

I am having some slowness with some image filtering I’m trying to do. I

  • 0

I am having some slowness with some image filtering I’m trying to do. I can fix the problem I’m having by simply caching the changes I make. However, I’d like to optimise this as much as I can without caching first, before I implement that. Basically, it’s slow, because I’m modifying multiple separate images of about 64×64 pixels each redraw. As I said, caching will fix this, but I want to optimise other ways first.

These are the two ideas I’ve had:

1.Reduce copying of image

I already have the image I want to modify, stored in an image, as a part of it. In other words, I have a sprite sheet loaded into memory, and so there is a portion of the image I want to modify for a new draw. Is there a way to grab imageData directly from the image, rather than having to draw the image to a new canvas first, then get the imageData from that? It seems inefficient to have to copy the image to a canvas, and then obtain the pixel data via getImageData.

2.Use drawImage instead of putImageData

drawImage seems to be much faster than putImageData. But I can’t find any way to draw my modified pixel data to a canvas through drawImage and avoiding putImageData altogether. Is there a way?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:50:57+00:00Added an answer on June 15, 2026 at 12:50 pm

    1: No. You need to draw the image on a canvas in order to obtain the imagedata.

    2: You can’t draw imagedata using anything else than putImageData. As you say, caching it into a new canvas or an Image is the solution for this. You can draw another canvas using drawImage just like you can draw an Image.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having some problem getting my program to sleep What im trying to do is
Having some annoying issues with loading images into a BufferedImage (image in the example)
Am having some trouble with the SkyDrive download process and hoping you can help
Having some difficulty trying to do this. I'm fetching an array of all submissions,
Having some trouble with this code. Trying to return a tuple of tuples (coordinates)
Having some experience with Linq to SQL I'm trying out ADO Entity framework now.
Having some difficulty with what I thought would be straight forward. I am trying
Having some odd behavior I'd love some feed back on as I can't seem
Having some trouble trying to put together a page where images are placed properly.
Having some issues with this search engine I am trying to put together. I'll

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.