Upgrading | image-go | Spatie       

 SPATIE  

image-go
========

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Image-go](https://spatie.be/docs/image-go/v1)  Upgrading

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/image-go/v1) 

  Upgrading    
- [ Introduction ](https://spatie.be/docs/image-go/v1/introduction)
- [ Postcardware ](https://spatie.be/docs/image-go/v1/postcardware)
- [ Installation and setup ](https://spatie.be/docs/image-go/v1/installation-and-setup)
- [ Supported formats ](https://spatie.be/docs/image-go/v1/formats)
- [ Questions &amp; issues ](https://spatie.be/docs/image-go/v1/questions-and-issues)
- [ Changelog ](https://spatie.be/docs/image-go/v1/changelog)
- [ About us ](https://spatie.be/docs/image-go/v1/about-us)
- [ Upgrading ](https://spatie.be/docs/image-go/v1/upgrading)
- [ Testing ](https://spatie.be/docs/image-go/v1/testing)
- [ Releasing ](https://spatie.be/docs/image-go/v1/releasing)

Usage
-----

- [ Basic usage ](https://spatie.be/docs/image-go/v1/usage/basic-usage)
- [ Saving images ](https://spatie.be/docs/image-go/v1/usage/saving-images)
- [ Retrieving properties ](https://spatie.be/docs/image-go/v1/usage/retrieving-properties)
- [ Colors ](https://spatie.be/docs/image-go/v1/usage/colors)

Image manipulations
-------------------

- [ Overview ](https://spatie.be/docs/image-go/v1/image-manipulations/overview)
- [ Resizing images ](https://spatie.be/docs/image-go/v1/image-manipulations/resizing-images)
- [ Optimizing images ](https://spatie.be/docs/image-go/v1/image-manipulations/optimizing-images)
- [ Adjustments ](https://spatie.be/docs/image-go/v1/image-manipulations/adjustments)
- [ Image canvas ](https://spatie.be/docs/image-go/v1/image-manipulations/image-canvas)
- [ Effects ](https://spatie.be/docs/image-go/v1/image-manipulations/effects)
- [ Adding a watermark ](https://spatie.be/docs/image-go/v1/image-manipulations/adding-a-watermark)
- [ Adding text ](https://spatie.be/docs/image-go/v1/image-manipulations/text)

 Upgrading
=========

###  On this page 

1. [ From PHP Image ](#content-from-php-image)
2. [ Release policy ](#content-release-policy)

From PHP Image
--------------------------------------------------------------------------------------------------

This package follows PHP Image's page structure and manipulation names, adapted to Go. PHP source is authoritative for behavior. The Rust port helped identify fit semantics, focal-coordinate differences and optimizer timing.

- Use `Load(ctx, path)`, `FromBytes(ctx, data)` or `New(ctx, width, height, background)` and check the returned error.
- Fluent methods mutate an image, retain the first error and return the image. Call `Save` or `Err` to check manipulation errors. Readers return explicit errors.
- `Save("")` overwrites the original path. `Encode` and `Base64` return in-memory data.
- `Size` returns typed width and height. `PickColor` returns an RGBA byte array instead of dynamically selected formats.
- `WithDriver` replaces the execution driver. The built-in driver requires ImageMagick 7 rather than PHP GD, Vips or Imagick extensions. Custom drivers use the ImageMagick-compatible MIFF stream protocol.
- Loading selects the first frame and automatically applies EXIF orientation, including mirror transforms. Animated output is not preserved.
- `FocalCrop` uses pixel centers, as the PHP source does. `FocalCropAndResize` uses percentage centers. There is no zoom argument.
- Watermark height uses `HeightUnit` independently from `WidthUnit`, unlike the current PHP implementation. Watermarks and overlay sources are not mutated.
- `BorderShrink` makes a uniform border by resizing the inner image to the exact remaining rectangle, which can distort its aspect ratio.
- `Text` coordinates refer to the top-left of the text layer rather than a baseline. Filtering and glyph rasterization may vary by engine version.
- Go's filesystem and byte buffers replace PHP's temporary-directory helper. This port does not copy another package's internals.

Source references at the initial port are PHP `spatie/image` commit `39909d963f56d6d2cf2ad7614e3840a3aa9350a8` and Rust `spatie/image-rust` commit `cc834f9`. Fixtures are generated through Go's standard PNG encoder, with the Go regular font from `golang.org/x/image` for portable text tests.

Release policy
--------------------------------------------------------------------------------------------------

The first release is `v0.1.0`. Later releases advance only the patch version, even for documented breaking changes. Never move a published tag. The website's `v1` documentation alias is independent of the Go module version.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
