Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Is there an alternative to imagemin? #26

Closed
lyzadanger opened this issue Nov 16, 2015 · 7 comments
Closed

Is there an alternative to imagemin? #26

lyzadanger opened this issue Nov 16, 2015 · 7 comments
Assignees
Labels

Comments

@lyzadanger
Copy link
Contributor

I ask because it makes npm install slow and node_modules pendulous. It's large in filesize and also slow because there is some compilation that happens.

This is so low priority I even hesitate to open a ticket. But I thought I'd ask.

See also imagemin/imagemin#97

@tylersticka
Copy link
Member

One thing to also keep in mind is that all of imagemin's bundled plugins will work without imagemin core, because they are valid Gulp plugins as well.

So if you think most of your assets will be SVG, you can skip including all of imagemin and just use the plugins you want.

There are examples in every official plugin's README, at the end of the "Usage" section. Example: https://github.com/imagemin/imagemin-jpegoptim#usage

Looking at our last few projects, they have had mostly SVG and PNG assets. Most of the JPGs we use are for FPO imagery. Occasionally GIFs are used as a fallback for old IE. We could try scaling back to just SVG and maybe PNG and add formats as a project dictates?

Ultimately, if we want to continue optimizing PNG, JPG, GIF and SVG by default, I doubt we'll find a smaller solution. But I'd be happy to be proven wrong!

@erikjung
Copy link
Contributor

I like @tylersticka's suggestion of just including dependencies for PNG and SVG.

I wonder if image optimization should even be a part of the "core" tasks at all. It may be best to separate it from the task of moving asset files and figure out a more surgical application. Also, some static hosting services have image optimization as part of the deployment process. This might be worth considering:

screen shot 2015-11-23 at 7 21 57 am

@tylersticka
Copy link
Member

I wonder if image optimization should even be a part of the "core" tasks at all. It may be best to separate it from the task of moving asset files and figure out a more surgical application. Also, some static hosting services have image optimization as part of the deployment process.

Revisiting this issue to say My Official Opinion™ is that we should remove image optimization entirely from these core tasks.

The description for this repo says "Gulp tasks that we usually need." But I've now disabled this task in multiple projects because it slows build down, even when there aren't any assets to crunch (which seems to be a more and more common occurrence).

I haven't recommended including SVG spriting in our core tasks because I still believe SVG solutions should be evaluated on a project by project basis. I believe that strategy should extend to image optimization as a whole.

@tylersticka
Copy link
Member

(And, bonus: It'll probably cut out the majority of npm install time and node_modules filesize.)

@erikjung
Copy link
Contributor

I have no objection to removing it.

On a similar topic, we can probably remove the optimizations from the CSS and JS tasks as well:

@tylersticka
Copy link
Member

@erikjung I'd ask @mrgerardorodriguez about that one first, I believe we actually used those on a still-in-progress project.

But you're right, it's probably a separate topic.

@gerardo-rodriguez
Copy link
Member

gerardo-rodriguez commented May 2, 2016

I believe we actually used those on a still-in-progress project.

@tylersticka @erikjung Great point! Yes, this is being used on a project at the moment.

But you're right, it's probably a separate topic.

Definitely worth further discussion, though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants