I'd like to create a bitmap (black and white) from within LuaTeX (or pdfTeX) and rescale it afterwards. For example (a 4x4 bitmap) could be made by
\makebitmap{0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0}
I don't really care about the interface. More important for me is the overall approach.
I would like to use it in LuaTeX, thus img.stream could be useful for me. But a PDFTeX approach with \pdf... commands would be fine, too.
Important restrictions: I must not create any intermediate file and it must work offline.
To make things clear: I am only interested in how to generate a bitmap graphics (png, bmp, whatever) within pdf/LuaTeX.
Background: I've developed a qrcode encoding lua library and I'd like make a LuaLaTeX package for it. I see three possible approaches:
- Use pdf instructions (
0 0 10 10 re ffor example) - Use
\rulecommands to make the black parts - Create a bitmap "file" and scale it.
I still experiment about the best approach.
I have tried with pdf instructions (item 1 above), and the result is ugly in some pdf viewer applications:

The black boxes are divided by some small white lines in some zoom settings. I want to avoid them. That is why I want to create bitmaps instead of pdf instructions.


.bmp(or.pngor ...): exactly what format do you require? – Joseph Wright Dec 30 '12 at 12:48pst-barcodethat creates a whole host of bar-code families. – Werner Dec 30 '12 at 19:38:)– خالد حسني Jan 03 '13 at 15:41pgfplotstableto define the pixel gray shade. – guillem Jan 07 '13 at 10:23\includegraphics{image.png}) inside a LaTeX PDF document. You don't want to create an external image file, right? Because PDF only supports JPEG and PNG but not BMP I think you might need to go with internal produced PNG, which might be very difficult for TeX. – Martin Scharrer Jan 07 '13 at 16:37