image icon indicating copy to clipboard operation
image copied to clipboard

Change letterbox color

Open darthf1 opened this issue 4 years ago • 2 comments

Images with fit="contain" get a black letterbox which I would like to change.

<nuxt-img src="/sample.png" height="40" width="125" fit="contain" />

Is it possible to change the letterbox color from black to something else?

darthf1 avatar Aug 16 '21 12:08 darthf1

I also require this feature in order to be able to use contain

stuible avatar Oct 08 '21 22:10 stuible

It seems to work with the modifier 'b' with IPX as provider. eg: <nuxt-img src="/sample.png" height="40" width="125" fit="contain" :modifiers="{ b: '#FFFFFF' }" />

I found it in the github ipx repo

I think that it's linked to this source code:

const operationsGenerator = createOperationsGenerator({
  keyMap: {
    format: 'f',
    fit: 'fit',
    width: 'w',
    height: 'h',
    resize: 's',
    quality: 'q',
    background: 'b'
  },
  joinWith: ',',
  formatter: (key, val) => encodeParam(key) + '_' + encodeParam(val)
})

jeanmatthieud avatar Dec 13 '21 09:12 jeanmatthieud