Exotic bitmap renderer for core drawing functions
If loop iterations are reduced


Loop iterations can be only lowered in occasions in which you use lineto or/and larger than 1 pixel pen size.


  If loop body computations are reduced


The padding computation can be omitted from each iteration. Videlicet the modulo % operator slows down tremendously. Nevertheless with your current approach of raster scan I believe you are combining minimum resources during the loop.


  If the function is smart enough to figure out where to use lineto or
  larger pen


Relates to the first idea for speculative optimization. Idea, that can be achieved along the second idea for optimization. And that is to give RLE-compressed (figuratively) image instead of raw image, which compression determines where to use line, where to use larger pen size or a combination of these two.



I've been through similar cases where optimizing is precious and with that consideration and in this particular circumstance I am only capable of confirming these "theories" as well as share your opinion about how useful that could be. Quite frequently people's first game projects are based on drawing from scratch.. and they have a hard time rendering images with the desired quality.