---
application: "Intervention Image"
version: "Version 2"
status: "eol"
---

# Image::widen

## Resize current image proportionally to given width



> public Intervention\Image\Image widen(integer $width, [Closure $callback])

Resizes the current image to new **width**, constraining aspect ratio. Pass an optional Closure **callback** as third parameter, to apply additional constraints like preventing possible upsizing.

### Parameters

#### width
The new width of the image

#### callback (optional)
Closure callback defining constraint to prevent unwanted **upsizing** of the image. See examples below.

> public Intervention\Image\Size upsize()

Keep image from being upsized.

### Return Values
Instance of `Intervention\Image\Image`

### Examples

```php
// resize image to new width
$img = Image::make('public/foo.jpg')->widen(300);

// resize image to new width but do not exceed original size
$img = Image::make('public/foo.jpg')->widen(300, function ($constraint) {
    $constraint->upsize();
});
```

### See also

- [heighten](https://image.intervention.io/v2/api/heighten.md)
- [resize](https://image.intervention.io/v2/api/resize.md)

---

## Become a Sponsor

### Intervention Image needs your help to keep the project going

Intervention Image is non-commercial, open source licensed and completely free to use. The considerable
effort required to maintain and develop the software is only possible with the financial support
of sponsors. There are two ways in which you can support this project.

- Support via [GitHub Sponsors](https://github.com/sponsors/Intervention)
- Support via [Ko-Fi](https://ko-fi.com/interventionphp)