Skip to content

Add embedColor() method #89

Closed
Closed

Description

@matylla

Hi @lovell

how much effort would it be to add embedColor([hex|rgba|rgba]) to the API?

Use case 1: Say I have an input portrait image 100 x 200 px and I would like the output image to be a square 200x200. So the remaining (empty) parts of the input image would be filled with a color of a choice.

Use case 2: Say I have the same input portrait image 100 x 200 px but this time I would like to have it resized by half 50 x 100px and embedded on a canvas of 200x200px. This way my input image would be centered in the canvas with a color of a choice.

Thanks in advance!

Activity

  1. lovell commented on Sep 16, 2014

    @lovell
    Owner

    Thanks for the suggestion @matylla. This looks like a feature to add at the same time #86 is worked on as both modify the behaviour of the existing embed* methods.

  2. added this to the v0.7.0 milestone on Oct 2, 2014
  3. added a commit that references this issue on Oct 2, 2014
  4. lovell commented on Oct 2, 2014

    @lovell
    Owner

    Hi @matylla, are you able to verify the new background and embed methods on the alpha branch meet your needs?

    npm install lovell/sharp#alpha
    
  5. lovell commented on Oct 13, 2014

    @lovell
    Owner

    This feature is now is master.

  6. lovell commented on Oct 17, 2014

    @lovell
    Owner

    This feature is in v0.7.0, now available via npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions