Questions tagged [imagemin]
91 questions
2
votes
2 answers
Vue cli 3 with imagemin webpack plugin
Using vue cli 3. How to correctly optimize all images png/jpg/svg from src/assets/images using https://www.npmjs.com/package/imagemin-webpack-plugin in vue.config.js:
const ImageminPlugin = require('imagemin-webpack-plugin').default
module.exports…

Alexander Kim
- 17,304
- 23
- 100
- 157
2
votes
1 answer
gulp-imagemin how to get the, compressed value, to a variable
I have tried to get the compressed value of: original size, minified size and space savings to a variable. So far only plugins that I have found are showing this data only in console.
Is there any easy way to get the same data displayed in the…

Cort4na_93
- 21
- 4
2
votes
1 answer
How to run 'imagemin' plugin with npm run script?
How could i use the imagemin plugin after having downloaded it with npm? Is there a way to run the plugin through 'npm run ' whenever i need to?

Dimitris Leon
- 73
- 2
- 6
2
votes
1 answer
Gulp-imagemin: how to preserve EXIF?
Is there a way to preserve metadata such as EXIF? I have been unable to find an option for this.

MDLR
- 75
- 7
2
votes
1 answer
How to set jpeg quality using imagemin-cli?
I am trying to use imagemin to compress images in an npm task. I am able to get the image slightly compressed using:
imagemin src/images/*.jpg -o dist/images --plugin=jpegtran
but I can't find anything in the imagemin-cli docs on how to pass an…

Thomas
- 465
- 1
- 4
- 14
2
votes
2 answers
Imagemin not enough for google page speed insights?
I am using gulp-imagemin for a while, but few months ago i noticed that google page speed unsatisfied by my compressed images. I tried all combinations of settings but without result. Also tried imagemin-cli and direct jpegtran - all the same, on…

MadDocNC
- 670
- 5
- 17
2
votes
1 answer
how to use the imagemin buffer function
I'm trying to use the imagemin buffer function:
https://github.com/imagemin/imagemin
file.on('data', function (d) {
fileBuffer = Buffer.concat([fileBuffer, d]);
}).on('end', function () {
imagemin.buffer(fileBuffer, {
plugins: [
…

Chris Hansen
- 7,813
- 15
- 81
- 165
2
votes
2 answers
how to pass a buffer to imagemin module in node.js?
In older version of imagemin I was able to pass the module a buffer like so:
new ImageMinify()
.src(StreamOrBuffer)
.use(ImageMinify.jpegtran({progressive: true}))
In the current version of imagemin there is no src function and calling the…

gmadar
- 1,884
- 3
- 19
- 22
2
votes
1 answer
gulp imagemin breaking SVG mask
I have an SVG file like this:
2
votes
1 answer
imagemin error [TypeError: (input, output, opts) => {
function minBytes(originalFilePath, destinationFilePath) {
return new Promise(function (resolve, reject){
var Imagemin = require('imagemin');
console.log(originalFilePath) // /app/public/images/temporary/4du_QIGCJb5.jpeg
…

user1775888
- 3,147
- 13
- 45
- 65
2
votes
1 answer
gulp-imagemin optional dep failed
As stated in the title, when i try to
npm install gulp-imagemin
It throws these errors:
npm WARN optional dep failed, continuing imagemin-gifsicle@1.0.0
npm WARN optional dep failed, continuing imagemin-pngquant@1.0.2
npm WARN optional dep failed,…

pwnjack
- 1,096
- 3
- 17
- 26
1
vote
0 answers
imagemin-pngquant cannot execute binary
I am trying to use imagemin with imagemin-pngquant to reduce images in an AWS Lambda function. Here is the code that I've made using the docs as a reference:
(image.data is the Buffer I'm creating from an axios .get() with arrayBuffer as the…

Joel Hager
- 2,990
- 3
- 15
- 44
1
vote
0 answers
Error: spawn /Users/XXXX/node_modules/optipng-bin/vendor/optipng ENOENT
I'm trying to compress the picture before $npm run build:test in my project(Vue3 + vite)
I wrote a script
I need to overwrite the original image. There are multiple folders under assets / images, so you need to solve the path problem of dist and use…

tutu
- 11
- 1
1
vote
0 answers
GIT Cross platform Windows VS MacOS image file sizes / binary differs
I'm sharing a project between MacOS and Windows users anytime making changes with JS or SCSS files we run webpack (used gulp previously) for production. After running webpack untouched image file sizes differ. They look the same but binary is…

Tony Keiser
- 51
- 5
1
vote
1 answer
How to fix below file error while compress images by electron app using imagemin?
I have created a basic image compression app using electron and imagemin which is working fine when running usin npm start command.
After that i packaged the app using electron packager and run the exe file and tried to compress the image…

user8115627
- 108
- 8