1

Does anybody know how I can create an "arbitrarily" sized picture data url, with a single color - without using canvas?

Basically, I'd like to create a GIF or PNG with a certain color and size. I need this to create place holder images with the correct dimensions, while waiting for the server to send proper images.

I want this because it will perform well on a mobile phone, in combination with width: 100%. The image would consume the correct amount of pixels.

I don't want to use canvas because I imagine it would be slower than altering a couple of bytes in a data URL.

frodeborli
  • 1,537
  • 1
  • 21
  • 30
  • http://www.matthewflickinger.com/lab/whatsinagif/bits_and_bytes.asp – Dark Falcon Apr 20 '15 at 12:51
  • 1
    Have you tested the performance of a canvas? I imagine a single create, rectangular write, and read to URL will be faster than pseudo-binary string manipulation. – ssube Apr 20 '15 at 12:53

0 Answers0