---
title: "Codecs"
canonical: https://www.graphicsmill.com/samples/tags/codecs
product: "Graphics Mill"
---

# Codecs

Image codecs for various formats

- [Browse all samples](<https://www.graphicsmill.com/samples/index_md>)

## Samples

- [Add a tiled watermark to PDF pages](<https://www.graphicsmill.com/samples/Codecs/Pdf/AddWatermark_cs_md>): Adds a semi-transparent, rotated tiled text watermark to every page of a PDF file.
- [Add and remove pages in an existing PDF](<https://www.graphicsmill.com/samples/Codecs/Pdf/AddAndRemovePages_cs_md>): Rebuilds an existing PDF page by page, removing one page and inserting a new one.
- [Combine multiple PDF files into one document](<https://www.graphicsmill.com/samples/Codecs/Pdf/MergePages_cs_md>): Combines the pages of several existing PDF files into one multi-page PDF document.
- [Compare Image Format Compressions](<https://www.graphicsmill.com/samples/Codecs/WebP/CompareImageFormatCompressions_cs_md>): Compare compression efficiency of WebP, JPEG, and PNG formats.
- [Convert And Write JPEG](<https://www.graphicsmill.com/samples/Codecs/Jpeg/ConvertAndWriteJpeg_cs_md>): Converts an image to 24bpp RGB format and saves it as a JPEG file.
- [Convert Animated GIF Image To WebP](<https://www.graphicsmill.com/samples/Codecs/WebP/ConvertAnimatedGifImageToWebP_cs_md>): Convert an animated GIF image to WebP format, preserving animation.
- [Convert Clipping Path To TGA](<https://www.graphicsmill.com/samples/Codecs/Tga/ConvertClippingPathToTga_cs_md>): Converts a clipping path from a JPEG to an alpha channel and saves as TGA.
- [Convert From WPF](<https://www.graphicsmill.com/samples/Interoperability/WPFInteroperability/ConvertFromWPF_cs_md>): Convert a WPF BitmapFrame to a GraphicsMill Bitmap.
- [Convert To Indexed](<https://www.graphicsmill.com/samples/ColorManagement/ConvertingPixelFormats/ConvertToIndexed_cs_md>): Converts an RGB image to an 8-bit indexed format with dithering and a custom palette.
- [Convert To WPF](<https://www.graphicsmill.com/samples/Interoperability/WPFInteroperability/ConvertToWPF_cs_md>): Convert a GraphicsMill Bitmap to a WPF BitmapSource.
- [Create a die-cut outline around artwork](<https://www.graphicsmill.com/samples/Drawing/Paths/CreateDieCutOutline_cs_md>): Traces the outline of a PNG with transparency, offsets and smooths it, and writes it as a spot-colour cut line to PDF.
- [Create a PDF/VT file with personalized business cards](<https://www.graphicsmill.com/samples/Codecs/Pdf/CreatePdfVT_cs_md>): Creates a PDF/VT file with personalized business card records for a batch of recipients.
- [Create a PDF/X-4 file with CMYK output intent](<https://www.graphicsmill.com/samples/Codecs/Pdf/CreateX4_cs_md>): Creates a PDF/X-4 file with CMYK output intent and color-managed images.
- [Create Business Card](<https://www.graphicsmill.com/samples/Codecs/Pdf/CreateBusinessCard_cs_md>): Creates a business card layout and saves it as a PDF file.
- [Create Multipage PDF](<https://www.graphicsmill.com/samples/Codecs/Pdf/CreateMultipagePDF_cs_md>): Generates personalized multipage PDF invitations with variable data.
- [Crop Jpeg Losslessly](<https://www.graphicsmill.com/samples/Codecs/Jpeg/CropJpegLosslessly_cs_md>): Performs a lossless crop on a JPEG image and saves the result.
- [Draw On PDF With Spot Color](<https://www.graphicsmill.com/samples/Codecs/SpotColors/DrawOnPdfWithSpotColor_cs_md>): Fills a rectangle with a PANTONE spot color in a PDF document.
- [Draw Spot On CMYK](<https://www.graphicsmill.com/samples/Codecs/SpotColors/DrawSpotOnCmyk_cs_md>): Draws text and an image on a spot channel over a CMYK background in a PDF.
- [Enum Container Elements](<https://www.graphicsmill.com/samples/Codecs/VectorFormats/EnumContainerElements_cs_md>): Enumerate and print the elements of a graphics container from a PDF file.
- [Fade and shape images with soft masks](<https://www.graphicsmill.com/samples/Drawing/ClippingPaths/ApplySoftMask_cs_md>): Fades a photo with a gradient luminosity mask and cuts another to the shape of a PNG with an alpha mask, then writes them to PDF.
- [Flip Jpeg Losslessly](<https://www.graphicsmill.com/samples/Codecs/Jpeg/FlipJpegLosslessly_cs_md>): Flips a JPEG image horizontally without recompression, preserving image quality.
- [Lay out paragraphs, lists, and tab-aligned columns in a PDF](<https://www.graphicsmill.com/samples/Codecs/Pdf/AdvancedTypography_cs_md>): Lays out paragraphs, a bulleted list, and a dot-leader tab-aligned schedule directly in a PDF.
- [Load Multiframe Image](<https://www.graphicsmill.com/samples/Codecs/LoadingAndSavingImages/LoadMultiframeImage_cs_md>): Loads a multi-frame TIFF image and saves each frame as a separate JPEG file.
- [Load Save Stream](<https://www.graphicsmill.com/samples/Codecs/LoadingAndSavingImages/LoadSaveStream_cs_md>): Loads an image from a stream, applies JPEG quality settings, and saves it to another stream.
- [Overlay one PDF's graphics onto another](<https://www.graphicsmill.com/samples/Codecs/Pdf/OverlayPages_cs_md>): Overlays the vector content of one PDF, a seal, onto every page of another PDF.
- [PDF Layers](<https://www.graphicsmill.com/samples/Codecs/Pdf/Layers_cs_md>): Creates a PDF document with multiple visible and invisible layers.
- [PDF To SVG](<https://www.graphicsmill.com/samples/Codecs/VectorFormats/PdfToSVG_cs_md>): Convert vector content from a PDF file to SVG format.
- [Place JPEG photos into a PDF without recompression](<https://www.graphicsmill.com/samples/Codecs/Pdf/PlaceJpegWithoutRecompression_cs_md>): Embeds RGB and CMYK JPEG files into a PDF byte for byte with CompressedImage, which is faster and uses less memory than decoding and recompressing them.
- [Png NeuQuant Example](<https://www.graphicsmill.com/samples/Codecs/Png/PngNeuQuantExample_cs_md>): Saves images to PNG using various bit depths, quantization, and dithering methods.
- [Rasterize a PDF page two ways: quick vs. full control](<https://www.graphicsmill.com/samples/Codecs/Pdf/RasterizePdfTwoWays_cs_md>): Compares PdfFrame.GetBitmap, a quick RGB24 preview, against GraphicsContainerRasterizer, which allows any pixel format and resolution.
- [Read and Write JPEG](<https://www.graphicsmill.com/samples/Codecs/Jpeg/ReadAndWriteJpeg_cs_md>): Reads a JPEG image, flips it vertically, and saves it as a new JPEG with high-quality settings.
- [Read and write PDF page boxes](<https://www.graphicsmill.com/samples/Codecs/Pdf/PageBoxes_cs_md>): Defines print production page boxes (bleed, trim, art) on a 300 DPI PDF using UnitConverter, then reads them back with PdfReader.
- [Read Animated Gif](<https://www.graphicsmill.com/samples/Codecs/Gif/ReadAnimatedGif_cs_md>): Reads all frames from an animated GIF and saves each as a separate file.
- [Read Convert And Write TGA](<https://www.graphicsmill.com/samples/Codecs/Tga/ReadConvertAndWriteTga_cs_md>): Reads a TGA image, converts it to 16-bit with RLE compression, and saves it.
- [Read Extra Channel From TIFF](<https://www.graphicsmill.com/samples/Codecs/Tiff/ReadExtraChannelFromTiff_cs_md>): Extracts an extra channel from a TIFF image and saves it as a new TIFF file.
- [Read Image Metadata](<https://www.graphicsmill.com/samples/Codecs/LoadingAndSavingImages/ReadImageMetadata_cs_md>): Reads EXIF and IPTC metadata from an image file without loading bitmap data.
- [Read image with WPF](<https://www.graphicsmill.com/samples/Codecs/CustomCodecs/ReadImageWithWPF_cs_md>): Shows how to use a custom WPF image reader to pass an image into a processing pipeline.
- [Read Multiframe TIFF](<https://www.graphicsmill.com/samples/Codecs/Tiff/ReadMultiframeTiff_cs_md>): Reads a multi-frame TIFF image and saves each frame as a JPEG file.
- [Read Multiframe TIFF Memory Friendly](<https://www.graphicsmill.com/samples/Codecs/Tiff/ReadMultiframeTiffMemoryFriendly_cs_md>): Reads a multi-frame TIFF using a memory-friendly pipeline and saves each frame as JPEG.
- [Read RAW Image](<https://www.graphicsmill.com/samples/Codecs/RAW/ReadRaw_cs_md>): Reads a RAW image file and saves it as a JPEG image.
- [Read TIFF](<https://www.graphicsmill.com/samples/Codecs/Tiff/ReadTiff_cs_md>): Reads the first frame of a TIFF image and saves it as a JPEG file.
- [Recolor Red Strokes](<https://www.graphicsmill.com/samples/Codecs/VectorFormats/RecolorRedStrokes_cs_md>): Detect and recolor red strokes in a graphics container.
- [Recompress JPEG partially](<https://www.graphicsmill.com/samples/Codecs/Jpeg/RecompressJpegPartially_cs_md>): Applies a mosaic effect to a region of a JPEG image and updates only that region using partial recompression.
- [Replace Process Color](<https://www.graphicsmill.com/samples/Codecs/SpotColors/ReplaceProcessColor_cs_md>): Converts a process color to a spot color and saves the result as a PDF.
- [Resize Animated Gif](<https://www.graphicsmill.com/samples/Codecs/Gif/ResizeAnimatedGif_cs_md>): Resizes an animated GIF to fixed dimensions while preserving animation properties.
- [Resize while reading JPEG](<https://www.graphicsmill.com/samples/Codecs/Jpeg/ResizeWhileReadingJpeg_cs_md>): Resizes a JPEG image by a factor of 2 during decoding using the codec’s built-in scaling.
- [Rotate JPEG losslessly](<https://www.graphicsmill.com/samples/Codecs/Jpeg/RotateJpegLosslessly_cs_md>): Rotates a JPEG image 90 degrees clockwise without recompression, preserving quality.
- [Save Multiframe Image](<https://www.graphicsmill.com/samples/Codecs/LoadingAndSavingImages/SaveMultiframeImage_cs_md>): Saves multiple images as frames in a single multipage TIFF file.
- [Save Spot Image To PDF](<https://www.graphicsmill.com/samples/Codecs/SpotColors/SaveSpotImageToPdf_cs_md>): Creates an image with a spot color and saves it to a PDF file.
- [Save Vector Content To JPEG](<https://www.graphicsmill.com/samples/Codecs/VectorFormats/SaveToJpeg_cs_md>): Rasterize PDF vector content and save as JPEG.
- [Supply linked images when reading SVG](<https://www.graphicsmill.com/samples/Codecs/VectorFormats/ResolveSvgImages_cs_md>): Resolves the image references of an SVG from a local asset cache with the ResolveImage callback and converts the SVG to PDF.
- [SVG To PDF](<https://www.graphicsmill.com/samples/Codecs/VectorFormats/SVGToPdf_cs_md>): Convert an SVG file to PDF format.
- [TIFF Extra Channels To Spot Color Space](<https://www.graphicsmill.com/samples/Codecs/SpotColors/TiffExtraChannelsToPdfSpot_cs_md>): Converts a TIFF with extra channels to a PDF using separation color space.
- [Update JPEG metadata losslessly](<https://www.graphicsmill.com/samples/Codecs/Jpeg/UpdateJpegMetadataLosslessly_cs_md>): Updates JPEG metadata (IPTC, EXIF, XMP) without recompressing the image.
- [Write Animated Gif](<https://www.graphicsmill.com/samples/Codecs/Gif/WriteAnimatedGif_cs_md>): Creates an animated GIF by generating frames with a moving green circle.
- [Write Animated WebP](<https://www.graphicsmill.com/samples/Codecs/WebP/WriteAnimatedWebP_cs_md>): Create a simple animated image in WebP format.
- [Write bitmap to EPS](<https://www.graphicsmill.com/samples/Codecs/Eps/WriteBitmapToEps_cs_md>): Loads a JPEG image and saves it directly as an EPS file.
- [Write Bitmap To PDF Memory Friendly](<https://www.graphicsmill.com/samples/Codecs/Pdf/WriteBitmapToPdfMemoryFriendly_cs_md>): Saves a JPEG image to PDF using a memory-friendly pipeline approach.
- [Write Extra Channel](<https://www.graphicsmill.com/samples/Codecs/Tiff/WriteExtraChannel_cs_md>): Adds an extra alpha channel to a TIFF image using a grayscale bitmap.
- [Write Extra Channel With Display Info](<https://www.graphicsmill.com/samples/Codecs/Tiff/WriteExtraChannelWithDisplayInfo_cs_md>): Saves extra channels with display info to Adobe resources in a TIFF file.
- [Write Extra Channel With Name](<https://www.graphicsmill.com/samples/Codecs/Tiff/WriteExtraChannelWithName_cs_md>): Saves an extra channel with a custom name to a TIFF image using Adobe resources.
- [Write image with WPF](<https://www.graphicsmill.com/samples/Codecs/CustomCodecs/WriteImageWithWPF_cs_md>): Demonstrates saving an image from a pipeline using a custom WPF image writer.
- [Write Multiframe TIFF](<https://www.graphicsmill.com/samples/Codecs/Tiff/WriteMultiframeTiff_cs_md>): Create a TIFF file with multiple frames, each with its own compression.
- [Write PNG Image](<https://www.graphicsmill.com/samples/Codecs/Png/WritePng_cs_md>): Reads a JPEG image, flips it vertically, and saves it as a PNG file.
- [Write raster and vector graphics to EPS](<https://www.graphicsmill.com/samples/Codecs/Eps/WriteRasterAndVectorGraphicsToEps_cs_md>): Creates an EPS file with both a bitmap and vector graphics, including shapes and styled text.
- [Write Raster And Vector Graphics To PDF](<https://www.graphicsmill.com/samples/Codecs/Pdf/WriteRasterAndVectorGraphicsToPdf_cs_md>): Saves both raster and vector graphics to a PDF file with compression.
- [Write Text To PDF](<https://www.graphicsmill.com/samples/Codecs/Pdf/WriteTextToPDF_cs_md>): Writes plain and round text as PDF text with embedded fonts.
- [Write TGA](<https://www.graphicsmill.com/samples/Codecs/Tga/WriteTga_cs_md>): Reads a JPEG image, flips it vertically, and saves it as a TARGA file.
- [Write TIFF](<https://www.graphicsmill.com/samples/Codecs/Tiff/WriteTiff_cs_md>): Convert a JPEG image to TIFF format with JPEG compression.
- [Write WebP](<https://www.graphicsmill.com/samples/Codecs/WebP/WriteWebP_cs_md>): Convert a JPEG image to WebP format with quality settings.
- [Write WebP Lossy And Lossless](<https://www.graphicsmill.com/samples/Codecs/WebP/WriteWebPLossyAndLossless_cs_md>): Save an image in both lossy and lossless WebP formats.

