I was trying to find a good way of drawing exact rectangles with arbitrary dimensions, came up with this, and decided to share it in case it's useful to anyone. The block for drawing a rectangle is in the first sprite, and if you run the project it lets you enter parameters to draw a rectangle or draw an example image using pixels with the dimensions of your choice. The only limitation is that you can't use width/height less than 2, or else there will be some extra bits sticking out. I'm not sure if that's fundamental limitation, but it's a limitation of the method that I used for this. You can confirm that the rectangles are exact by taking a screenshot or saving a picture of the stage; if you zoom in, the rectangles should solid blocks of color, without any blending of pixels on the edges.
This version is modified to work in Scratch 3.0, since the pen rendering has changed. I've also changed the way coordinates are interpreted to be more like how pen uses coordinates. 2020-08-10: Apparently pen rendering changed again?? Anyway as far as I can tell this is working again