A standalone Tauri v2 + raw WebGL 1 example for loading still images, processing them in a fragment shader, comparing original and processed results, and exporting full-resolution PNG or JPEG files.
Native-open and operating-system drop paths are read by Rust and returned to the WebView as an optimized binary IPC response. The frontend creates a temporary Blob URL before uploading the image to WebGL. This avoids WKWebView origin-security errors that can occur when an asset: URL is used directly as a WebGL texture source.
npm install
npm run dev
Native/browser image
↓
WebView image decoder
↓
WebGL texture
↓
Framing transform
↓
Color grade + stylization shader
↓
Preview / comparison / PNG-JPEG export
The initial asset-protocol scope is empty. When the user selects or drops an image, Rust canonicalizes the path, confirms that it is a supported file, authorizes that exact file for the current session, and returns the path to the WebView. The frontend converts it with convertFileSrc().
Processed exports temporarily resize the WebGL canvas to the requested dimensions, render without the comparison guide, encode the result, then restore the preview size. Original exports use a temporary 2D canvas at the source image dimensions.
Large native exports are written through sequential 1 MiB chunks rather than one oversized IPC message.
MAX_VIEWPORT_DIMS for the active WebGL context.16-tauri-v2-image-texture-processor