Skip to content

How to programatically create image? #458

Answered by oscarotero
cawa-93 asked this question in Q&A
Discussion options

You must be logged in to vote

The short answer: you can use this experimental plugin that not only generates all favicons but also generate the html tags to import them.

If you want to use the imagick plugin, you can do something like this in your _config (I didn't test it):

// Load the imagick plugin
site.use(imagick());

// Assign the `imagick` variable to the original image with all transformations
const transforms = [
  {
    size: [16, 16],
    format: "ico",
  }, {
    size: [32, 32],
    format: "png",
    sufix: "-x32",
  },
];
site.data("imagick", transforms, "/images/original-picture.png");

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@cawa-93
Comment options

@cawa-93
Comment options

@cawa-93
Comment options

Answer selected by cawa-93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants