// Write image to a specific file (format auto-detected from extension)
ImageWrite( myImage, "output/photo.png" );
ImageWrite( myImage, "output/photo.jpg" ); // → JPEG
ImageWrite( myImage, "output/photo.webp" ); // → WebP
ImageWrite( myImage, "output/photo.gif" ); // → GIF
// Write image back to its original location (modify in place)
img = ImageRead("photo.jpg");
img.blur(5);
img.write(); // Writes back to photo.jpg
// Write to a new location with directory creation
ImageWrite( myImage, "deep/nested/path/photo.png" ); // Creates directories automatically
// As a member function (chainable)
myImage.resize(800, 600)
.blur(2)
.write("output/edited.png");