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 7511671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:37:21+00:00 2026-05-29T23:37:21+00:00

My problem: I’m making an HTML5 game and am attempting to make it faster

  • 0

My problem:
I’m making an HTML5 game and am attempting to make it faster by drawing the background once instead of having it redrawn every frame.
To do this I drew the background on the canvas and then attempted to get an ImageData from it. Unfortunately I was stopped by a Security Error. Unable to, because the image is from an external source.
I’ve researched this and it seems that this is a “feature” to stop bad people from stealing content from the user’s hard drive. Though these images I loaded aren’t from the hard drive.

I would really love to be able to speed up my game. Is there a solution to go around the security error or maybe even to load the image directly into an image data so I can draw by looping through pixels?

(Note: I do not want to have to mess with multiple canvases to get the job done)

Thanks, Gan

  • 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-05-29T23:37:22+00:00Added an answer on May 29, 2026 at 11:37 pm

    There is no way around that, though you can draw an image from another domain the use of getImageData will always raise a security error in that situation. That is to prevent stealing of sensitive information since web sites can generate dynamic images containing private user information based on cookies or IP address. However, you could simply use a server side script to proxy the image.

    But honestly getImageData and putImageData are fairly slow, I don’t see how that could speed up your game. It seems to me that you think drawing an image data is faster than simply using drawImage, it’s not.

    You will have to redraw everything if you want your animation to look good anyway, that’s the way animation works.

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

Sidebar

Related Questions

Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has
Problem Description: Multi-player Game that works over the some kind of network, in game
Problem background: I have a Qt/QML Symbian application targeting Qt 4.7.4, that requires a
Problem: I'm attempting to disable a radio button by using the code below. This
PROBLEM : I am having problems getting socket.IO to connect in some circumstances, so
Problem: Every time I start a new session of Internet Explorer, the web application
Problem: How to make Meta-x work in emacs? Hi I am a newcomer to
Problem : The problem I’m having is when I zoom into my UIScrollView (with
Problem: I'm making a web service that allows developers to 'register' their Mongoose schemas
Problem I am drawing a bar chart with Core Plot . My implementation of

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.