2

Running the Light API of Pixellena I get a message similar to Not possible to create a webp that has a smaller size and also preserves quality of the original file, and my call does not return an image. How can I fix this so that I get the resulting optimized image?

LukeBowl
  • 200
  • 2
  • 13

1 Answers1

1

It is a good question! It is explained on the Pixellena FAQ page, but actually it does not give any solution there. There is a solution though. You can use the Lux API instead, and set the max_overhead parameter to get an optimized image. With this parameter set you can get an optimized image bigger than the original image times the value of this parameter, as mentioned on their doc. e.g 'original image size: 10KB, max_overhead: 10, you can get an optimized image till 100KB'. Of course it can be smaller than 100KB. In fact the API will find the smaller one possible. ​ See below how you should set the adjustments for that: ​

{
    "encoder": {
        "max_overhead": 10
    }
}

​ Please give it a try. Hope that it can help you.

  • Ok thanks, so this `max_overhead` is fixed then in the Light API or? – LukeBowl Nov 19 '20 at 21:03
  • Hmm good question again. I just read a bit the [light API](https://pixellena.com/docs/light-api/) and in fact you can use the `max_overhead` there as well. It defaults to `0.99`, but you can send the `max_overhead` on the `light API` request data as well. I need to test that though. – Neyvis Remon Gonzalez Nov 19 '20 at 21:17
  • I can confirm that it works with the light API, passing the max_overhead on the request data to the API request. I just tested it. – Neyvis Remon Gonzalez Nov 19 '20 at 21:55