{"_id":"@bun-win32/gdiplus","_rev":"5-9714eb2fd3d7ff425bd2a7bbde45b1be","name":"@bun-win32/gdiplus","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/gdiplus","version":"1.0.0","keywords":["bun","ffi","win32","windows","gdiplus","gdi+","image","png","jpeg","graphics","2d","rendering","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/gdiplus@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"6e58d2b1c6c540a23b7027ed6a40b237f92db057","tarball":"https://registry.npmjs.org/@bun-win32/gdiplus/-/gdiplus-1.0.0.tgz","fileCount":6,"integrity":"sha512-H/UskYdzfbUbLLC+PTVl241ya0YGEEfh0nKB4Rw1kltuw8M/7Yn2TugjyyLI1XeAhD/nQVwl+M66ski03DlqdQ==","signatures":[{"sig":"MEUCIQDeEZo5STd8ZeJfZqh8V8M+3MHPwyVsLBPAMp676FPcSQIgJOjJ8zco2UQMfCLe3BJpeWjdsrWPB03C3MNzFq4iYxY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":278573},"main":"./index.ts","type":"module","module":"index.ts","shasum":"6e58d2b1c6c540a23b7027ed6a40b237f92db057","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:image-diagnostic":"bun ./example/image-diagnostic.ts","example:generative-poster":"bun ./example/generative-poster.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-H/UskYdzfbUbLLC+PTVl241ya0YGEEfh0nKB4Rw1kltuw8M/7Yn2TugjyyLI1XeAhD/nQVwl+M66ski03DlqdQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/gdiplus"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 GDI+ bindings for Bun (FFI) on Windows — image load/save, antialiased 2D drawing, fonts, paths, brushes, color matrix effects.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/gdiplus_1.0.0_1778689580936_0.7676490460551681","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/gdiplus","version":"1.0.1","keywords":["bun","ffi","win32","windows","gdiplus","gdi+","image","png","jpeg","graphics","2d","rendering","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/gdiplus@1.0.1","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"89668e78d5a5403bf515485aed3307f9d7d5f4d1","tarball":"https://registry.npmjs.org/@bun-win32/gdiplus/-/gdiplus-1.0.1.tgz","fileCount":6,"integrity":"sha512-QXvxqWfavCCkrH+fmQDlAKVD2gHcO1F4j+PYn7IkOEyJpnr0vCYOF5czgj2v1QV9CEsCDS+Z+YUmUclyruXVSQ==","signatures":[{"sig":"MEYCIQCIWwqINTbPqSLmf7eo4VPL7bR/5FyN/px7/ktg+KUSQgIhAOVXbfzViZLwPheHd1pBrgyPwY6dAav6foUk/bGV8bmF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":278594},"main":"./index.ts","type":"module","module":"index.ts","shasum":"89668e78d5a5403bf515485aed3307f9d7d5f4d1","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:image-diagnostic":"bun ./example/image-diagnostic.ts","example:generative-poster":"bun ./example/generative-poster.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-QXvxqWfavCCkrH+fmQDlAKVD2gHcO1F4j+PYn7IkOEyJpnr0vCYOF5czgj2v1QV9CEsCDS+Z+YUmUclyruXVSQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/gdiplus"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 GDI+ bindings for Bun (FFI) on Windows — image load/save, antialiased 2D drawing, fonts, paths, brushes, color matrix effects.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/gdiplus_1.0.1_1780581907413_0.30084674303155934","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@bun-win32/gdiplus","version":"1.0.2","keywords":["bun","ffi","win32","windows","gdiplus","gdi+","image","png","jpeg","graphics","2d","rendering","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/gdiplus@1.0.2","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"814d07177e9aecbc9f26d84903d564208c60c172","tarball":"https://registry.npmjs.org/@bun-win32/gdiplus/-/gdiplus-1.0.2.tgz","fileCount":6,"integrity":"sha512-SJynD474V40f+LY+f+XirqR/gIyyOvJZ3j/1UuNrit3RiM2+GUcQ8VlOkE6QZiuQJvrJA+wJ9IIun+N0gM3i2w==","signatures":[{"sig":"MEYCIQCWPmSj+TMB1CWQqAH9zUgjJauyR5Yo1UU0Xle2AUtbAQIhAI39ekWcNTEFOlBHUgGYwI2KIN6rlG4cbaSutaIc6jHE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":278599},"main":"./index.ts","type":"module","module":"index.ts","shasum":"814d07177e9aecbc9f26d84903d564208c60c172","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:image-diagnostic":"bun ./example/image-diagnostic.ts","example:generative-poster":"bun ./example/generative-poster.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-SJynD474V40f+LY+f+XirqR/gIyyOvJZ3j/1UuNrit3RiM2+GUcQ8VlOkE6QZiuQJvrJA+wJ9IIun+N0gM3i2w==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/gdiplus"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 GDI+ bindings for Bun (FFI) on Windows — image load/save, antialiased 2D drawing, fonts, paths, brushes, color matrix effects.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/gdiplus_1.0.2_1781130839424_0.21592137777845632","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/gdiplus","version":"2.0.0","keywords":["bun","ffi","win32","windows","gdiplus","gdi+","image","png","jpeg","graphics","2d","rendering","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/gdiplus@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"c8cb4ec69f1d6b04e244159ef5f9e64d1881bdc6","tarball":"https://registry.npmjs.org/@bun-win32/gdiplus/-/gdiplus-2.0.0.tgz","fileCount":6,"integrity":"sha512-pfnUPJLKiHAFMJ4s0MZJoAkfVGhcSLxkd8IE/LbNzKRLJpq5g2Q1Qkh1F0Y0eWyQ6Etcg9YE1TyQPZJXaXY7+A==","signatures":[{"sig":"MEUCIQCSA99212t8T0ekRQWV9iFEiYLrbTYDZ6UKDFmGHb1YhwIgaqit39Evv2BY2N/cVu45w0uH5I+xlAzx0C1drIlIwVg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":282898},"main":"./index.ts","type":"module","module":"index.ts","shasum":"c8cb4ec69f1d6b04e244159ef5f9e64d1881bdc6","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:image-diagnostic":"bun ./example/image-diagnostic.ts","example:generative-poster":"bun ./example/generative-poster.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-pfnUPJLKiHAFMJ4s0MZJoAkfVGhcSLxkd8IE/LbNzKRLJpq5g2Q1Qkh1F0Y0eWyQ6Etcg9YE1TyQPZJXaXY7+A==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/gdiplus"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 GDI+ bindings for Bun (FFI) on Windows — image load/save, antialiased 2D drawing, fonts, paths, brushes, color matrix effects.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/gdiplus_2.0.0_1782435317176_0.9791178759726584","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 GDI+ bindings for Bun (FFI) on Windows — image load/save, antialiased 2D drawing, fonts, paths, brushes, color matrix effects.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/gdiplus","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/gdiplus"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","gdiplus","gdi+","image","png","jpeg","graphics","2d","rendering","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:generative-poster":"bun ./example/generative-poster.ts","example:image-diagnostic":"bun ./example/image-diagnostic.ts"},"_id":"@bun-win32/gdiplus@2.0.1","_integrity":"sha512-S3W/NLwnCYoVIfr35TufAsOKhoIDAlvfs0FcURwdwtP2HA+OK6DakdIRmuviHfrn/c1zYaKHOryGxbsDYQLc7Q==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"bcebe17901556ab16bfd7c318618a206b1065657","dist":{"integrity":"sha512-S3W/NLwnCYoVIfr35TufAsOKhoIDAlvfs0FcURwdwtP2HA+OK6DakdIRmuviHfrn/c1zYaKHOryGxbsDYQLc7Q==","shasum":"bcebe17901556ab16bfd7c318618a206b1065657","tarball":"https://registry.npmjs.org/@bun-win32/gdiplus/-/gdiplus-2.0.1.tgz","fileCount":6,"unpackedSize":282898,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAHNWU5bQDbxOlV3JDRSb8lYbUWjzI+zCx8FxsKz9ej7AiEA0lp6OV5wtsMThXsEJw3TRWbx+hNYg56ZEUhWYwKceN4="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gdiplus_2.0.1_1782437780828_0.9604103338483914"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-13T16:26:20.793Z","modified":"2026-06-26T01:36:21.226Z","1.0.0":"2026-05-13T16:26:21.075Z","1.0.1":"2026-06-04T14:05:07.600Z","1.0.2":"2026-06-10T22:33:59.575Z","2.0.0":"2026-06-26T00:55:17.423Z","2.0.1":"2026-06-26T01:36:21.097Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","gdiplus","gdi+","image","png","jpeg","graphics","2d","rendering","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/gdiplus"},"description":"Zero-dependency, zero-overhead Win32 GDI+ bindings for Bun (FFI) on Windows — image load/save, antialiased 2D drawing, fonts, paths, brushes, color matrix effects.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/gdiplus\n\nZero-dependency, zero-overhead Win32 GDI+ bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/gdiplus` exposes the `gdiplus.dll` flat C API using [Bun](https://bun.sh)'s FFI. It provides a single class, `Gdiplus`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\n628 functions are bound — the complete documented surface of the GDI+ flat C API (`gdiplusflat.h`, plus the startup and memory helpers from `gdiplusinit.h`, `gdiplusmem.h`, `gdipluseffects.h`).\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `gdiplus.dll`: image loading and encoding (PNG, JPEG, BMP, GIF, TIFF, EMF, WMF, ICO), antialiased 2D drawing, paths, regions, gradients, brushes, fonts, custom line caps, color matrix effects, metafile recording.\n- In-source docs in `structs/Gdiplus.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Gdiplus.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases, full `Status` / `Unit` / `PixelFormat` / `SmoothingMode` / `WrapMode` / etc. enums (see `types/Gdiplus.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/gdiplus\n```\n\n## Quick Start\n\n```ts\nimport Gdiplus, {\n  PixelFormat32bppARGB,\n  SmoothingMode,\n  Status,\n} from '@bun-win32/gdiplus';\n\n// 1. Bootstrap GDI+ (call once per process; pair with GdiplusShutdown).\nconst tokenBuffer = Buffer.alloc(8);\nconst startupInput = Buffer.alloc(16); // GdiplusStartupInput\nstartupInput.writeUInt32LE(1, 0); // GdiplusVersion = 1\nGdiplus.GdiplusStartup(tokenBuffer.ptr, startupInput.ptr, null);\nconst token = tokenBuffer.readBigUInt64LE(0);\n\n// 2. Open an existing image from disk.\nconst path = Buffer.from('input.png\\0', 'utf16le');\nconst imageHandle = Buffer.alloc(8);\nGdiplus.GdipLoadImageFromFile(path.ptr, imageHandle.ptr);\nconst image = imageHandle.readBigUInt64LE(0);\n\n// 3. Query its dimensions.\nconst widthBuf = Buffer.alloc(4);\nGdiplus.GdipGetImageWidth(image, widthBuf.ptr);\nconsole.log('width =', widthBuf.readUInt32LE(0));\n\n// 4. Tear down.\nGdiplus.GdipDisposeImage(image);\nGdiplus.GdiplusShutdown(token);\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\nbun run example:generative-poster   # procedurally render & save a 1200x900 PNG\nbun run example:image-diagnostic    # enumerate codecs + inspect an image file\n```\n\n## Notes\n\n- Always call `GdiplusStartup` before any other `Gdip*` function. `GdiplusShutdown` cleans up.\n- Opaque GDI+ objects (`GpBitmap`, `GpImage`, `GpGraphics`, `GpPen`, `GpBrush`, `GpFont`, etc.) are modeled as `bigint` handles. Create them, capture the handle from the out-buffer, dispose them with the appropriate `GdipDispose*` / `GdipDelete*` call.\n- The flat C API takes `Gp*` pointers by value. Out parameters (`Gp* *bitmap`) take a `Pointer` to an 8-byte buffer the caller reads after the call.\n- Most functions return a `Status` enum — `Status.Ok` (0) is success; anything else is an error from the `Status` enum (`OutOfMemory`, `InvalidParameter`, `FileNotFound`, …).\n- Either rely on lazy binding or call `Gdiplus.Preload()`.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}