GDK-PIXBUF-CSOURCE(1)
π gdk-pixbuf-csource β the girlies' guide π
okay so bestie, this is a page from the gdk-pixbuf-csource manual, and we're gonna get you fluent in it, no cap β¨
β¨ NAME β¨
gdk-pixbuf-csource β the C code generation utility for GdkPixbuf images π (yes she generates C code, she's an icon, she's a legend, and she IS the moment)
π¦ SYNOPSIS π¦
gdk-pixbuf-csource [OPTIONS...] <IMAGE>
πΈ DESCRIPTION πΈ
So gdk-pixbuf-csource is this adorable little utility that generates C code containing images π
which is genuinely so useful for compiling images directly into your programs. like, right in there. no external files. obsessed.
She works one of two ways, and honestly both are valid:
- you hand her one image file name and she generates code for it, OR
- with the
--build-listoption, you hand her a list of(name, image)pairs and she generates code for a whole list of images into named variables π«Ά
π¨ okay real talk bestie, listen up: this tool is mostly meant to be used for backward compatibility. Newly written applications and libraries should use GResource to embed image assets in their binary. that's the glow-up. that's the move. periodt.
π OPTIONS π
--streamβ generates a pixbuf data stream: a single string holding a serializedGdkPixdatastructure in network byte order β¨ (network byte order, bestie, she's consistent)--structβ generates aGdkPixdatastructure. heads up: your code needs theGdkPixdatastructure definition fromgdk-pixdata.hπ--macrosβ generates*_ROWSTRIDE,*_WIDTH,*_HEIGHT,*_BYTES_PER_PIXELand*_RLE_PIXEL_DATAor*_PIXEL_DATAmacro definitions for the image π--rleβ enables run-length encoding for the generated pixel data. this is the default π--rawβ disables run-length encoding for the generated pixel data π--externβ generatesexternsymbols π--staticβ generatesstaticsymbols. this is the default π--decoderβ provides a*_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp)macro definition to decode run-length encoded image data π§ (she's handing you the decoder bestie, use it)--name=identifierβ specifies the identifier name (the prefix!) for the generated variables or macros. ngl this is only useful if--build-listwas not specified π--build-listβ enables the(name, image)pair parsing mode π¦-h,--helpβ prints a brief help and exits. she's brief, she's helpful, she's leaving π-v,--versionβ prints the tool version and exits β--g-fatal-warningsβ makes warnings fatal, and causes the program to abort π so like, dramatic much? but yes, warnings = game over, she will not be tolerating any of that
π SEE ALSO π
The GdkPixbuf documentation, shipped by gdk-pixbuf, and also available online on docs.gtk.org β the exact page lives at https://docs.gtk.org/gdk-pixbuf/ π (iykyk, go read it, she's thorough)
π BUGS π
okay so there ARE some known issues and we're gonna be honest about them, no gatekeeping:
- The runlength encoder gets out of sync with the pixel boundaries, since it includes the rowstride padding in the encoded stream π like girl what.
- Furthermore, it generates pixbufs with suboptimal rowstride in some cases π
not me exposing her flaws β but fr fr, that's what the page says, so that's what you get π
πΈ that's the whole page bestie! and a lil' sign-off: this manual page is filed under the manual name gdk-pixbuf-csource, and it's part of the gdk-pixbuf package docs. mwah π go embed some images responsibly, and remember β new code, use GResource. periodt. πβ¨π
π¦ where this page comes from
- arch rolling: gdk-pixbuf2 2.44.8-1 Β· LGPL-2.0-or-later
- nixpkgs unstable: gdk-pixbuf 2.44.8
- ubuntu stonking: libgdk-pixbuf2.0-bin 2.44.8+dfsg-1 Β· LGPL-2.0-or-later AND LGPL-2.1-or-later AND CC0-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms