Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lovell/sharp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.29.0
Choose a base ref
...
head repository: lovell/sharp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.29.1
Choose a head ref
  • 16 commits
  • 28 files changed
  • 5 contributors

Commits on Aug 19, 2021

  1. Docs: serve docute from same hostname

    Cheapo corporate web proxies ignore CSP and rewrite HTML
    lovell committed Aug 19, 2021
    Copy the full SHA
    17e50de View commit details

Commits on Aug 20, 2021

  1. Copy the full SHA
    4e84f74 View commit details

Commits on Aug 26, 2021

  1. Set PNG bitdepth based on number of colours #2855

    Removes use of deprecated libvips API
    lovell committed Aug 26, 2021
    Copy the full SHA
    3402656 View commit details

Commits on Aug 28, 2021

  1. Copy the full SHA
    2031d7d View commit details

Commits on Aug 29, 2021

  1. Copy the full SHA
    60adc11 View commit details

Commits on Aug 30, 2021

  1. Copy the full SHA
    104464c View commit details
  2. Add lightness option to modulate operation

    Moebits authored and lovell committed Aug 30, 2021
    Copy the full SHA
    4a9267c View commit details
  3. Copy the full SHA
    e044788 View commit details

Commits on Sep 5, 2021

  1. Copy the full SHA
    5d98bcd View commit details
  2. Copy the full SHA
    b7fbffb View commit details
  3. Copy the full SHA
    afb2113 View commit details

Commits on Sep 6, 2021

  1. Resolve paths before comparing input/output destination (#2878)

    This fixes an issue where if you try to write to the same destination as the
    input file but you are not using absolute (or the same relative path) for both
    the input and output, sharp/vips might produce errors such as:
    
    someFile.jpg: unable to open for write
    unix error: No such file or directory
    rexxars authored Sep 6, 2021
    Copy the full SHA
    52307fa View commit details
  2. Copy the full SHA
    916b04d View commit details
  3. Copy the full SHA
    deb5d81 View commit details

Commits on Sep 7, 2021

  1. Bump deps

    lovell committed Sep 7, 2021
    Copy the full SHA
    9a0bb60 View commit details
  2. Release v0.29.1

    lovell committed Sep 7, 2021
    Copy the full SHA
    50c7a08 View commit details
12 changes: 10 additions & 2 deletions docs/api-operation.md
Original file line number Diff line number Diff line change
@@ -400,7 +400,9 @@ Returns **Sharp**

## modulate

Transforms the image using brightness, saturation and hue rotation.
Transforms the image using brightness, saturation, hue rotation, and lightness.
Brightness and lightness both operate on luminance, with the difference being that
brightness is multiplicative whereas lightness is additive.

### Parameters

@@ -409,20 +411,26 @@ Transforms the image using brightness, saturation and hue rotation.
* `options.brightness` **[number][1]?** Brightness multiplier
* `options.saturation` **[number][1]?** Saturation multiplier
* `options.hue` **[number][1]?** Degrees for hue rotation
* `options.lightness` **[number][1]?** Lightness addend

### Examples

```javascript
sharp(input)
.modulate({
brightness: 2 // increase lightness by a factor of 2
brightness: 2 // increase brightness by a factor of 2
});

sharp(input)
.modulate({
hue: 180 // hue-rotate by 180 degrees
});

sharp(input)
.modulate({
lightness: 50 // increase lightness by +50
});

// decreate brightness and saturation while also hue-rotating by 90 degrees
sharp(input)
.modulate({
53 changes: 51 additions & 2 deletions docs/api-output.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@ Note that raw pixel data is only supported for buffer output.
By default all metadata will be removed, which includes EXIF-based orientation.
See [withMetadata][1] for control over this.

The caller is responsible for ensuring directory structures and permissions exist.

A `Promise` is returned when `callback` is not provided.

### Parameters
@@ -328,6 +330,51 @@ The prebuilt binaries do not include this - see

Returns **Sharp**

## jp2

Use these JP2 options for output image.

Requires libvips compiled with support for OpenJPEG.
The prebuilt binaries do not include this - see
[installing a custom libvips][11].

### Parameters

* `options` **[Object][6]?** output options

* `options.quality` **[number][9]** quality, integer 1-100 (optional, default `80`)
* `options.lossless` **[boolean][7]** use lossless compression mode (optional, default `false`)
* `options.tileWidth` **[number][9]** horizontal tile size (optional, default `512`)
* `options.tileHeight` **[number][9]** vertical tile size (optional, default `512`)
* `options.chromaSubsampling` **[string][2]** set to '4:2:0' to use chroma subsampling (optional, default `'4:4:4'`)

### Examples

```javascript
// Convert any input to lossless JP2 output
const data = await sharp(input)
.jp2({ lossless: true })
.toBuffer();
```

```javascript
// Convert any input to very high quality JP2 output
const data = await sharp(input)
.jp2({
quality: 100,
chromaSubsampling: '4:4:4'
})
.toBuffer();
```

* Throws **[Error][4]** Invalid options

Returns **Sharp**

**Meta**

* **since**: 0.29.1

## tiff

Use these TIFF options for output image.
@@ -372,13 +419,15 @@ Use these AVIF options for output image.
Whilst it is possible to create AVIF images smaller than 16x16 pixels,
most web browsers do not display these properly.

AVIF image sequences are not supported.

### Parameters

* `options` **[Object][6]?** output options

* `options.quality` **[number][9]** quality, integer 1-100 (optional, default `50`)
* `options.lossless` **[boolean][7]** use lossless compression (optional, default `false`)
* `options.speed` **[number][9]** CPU effort vs file size, 0 (slowest/smallest) to 8 (fastest/largest) (optional, default `5`)
* `options.speed` **[number][9]** CPU effort vs file size, 0 (slowest/smallest) to 9 (fastest/largest) (optional, default `5`)
* `options.chromaSubsampling` **[string][2]** set to '4:2:0' to use chroma subsampling (optional, default `'4:4:4'`)

<!---->
@@ -405,7 +454,7 @@ globally-installed libvips compiled with support for libheif, libde265 and x265.
* `options.quality` **[number][9]** quality, integer 1-100 (optional, default `50`)
* `options.compression` **[string][2]** compression format: av1, hevc (optional, default `'av1'`)
* `options.lossless` **[boolean][7]** use lossless compression (optional, default `false`)
* `options.speed` **[number][9]** CPU effort vs file size, 0 (slowest/smallest) to 8 (fastest/largest) (optional, default `5`)
* `options.speed` **[number][9]** CPU effort vs file size, 0 (slowest/smallest) to 9 (fastest/largest) (optional, default `5`)
* `options.chromaSubsampling` **[string][2]** set to '4:2:0' to use chroma subsampling (optional, default `'4:4:4'`)

<!---->
28 changes: 28 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,34 @@

Requires libvips v8.11.3

### v0.29.1 - 7th September 2021

* Add `lightness` option to `modulate` operation.
[#2846](https://github.com/lovell/sharp/pull/2846)

* Ensure correct PNG bitdepth is set based on number of colours.
[#2855](https://github.com/lovell/sharp/issues/2855)

* Ensure background is always premultiplied when compositing.
[#2858](https://github.com/lovell/sharp/issues/2858)

* Ensure images with P3 profiles retain full gamut.
[#2862](https://github.com/lovell/sharp/issues/2862)

* Add support for libvips compiled with OpenJPEG.
[#2868](https://github.com/lovell/sharp/pull/2868)

* Remove unsupported animation properties from AVIF output.
[#2870](https://github.com/lovell/sharp/issues/2870)

* Resolve paths before comparing input/output filenames.
[#2878](https://github.com/lovell/sharp/pull/2878)
[@rexxars](https://github.com/rexxars)

* Allow use of speed 9 (fastest) for HEIF encoding.
[#2879](https://github.com/lovell/sharp/pull/2879)
[@rexxars](https://github.com/rexxars)

### v0.29.0 - 17th August 2021

* Drop support for Node.js 10, now requires Node.js >= 12.13.0.
1 change: 1 addition & 0 deletions docs/docute.min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions docs/humans.txt
Original file line number Diff line number Diff line change
@@ -218,3 +218,9 @@ GitHub: https://github.com/Daiz

Name: Mart Jansink
GitHub: https://github.com/mart-jansink

Name: Tenpi
GitHub: https://github.com/Tenpi

Name: Zaruike
https://github.com/Zaruike
Loading