rbuchberger / jekyll_picture_tag

Easy responsive images for Jekyll.
https://rbuchberger.github.io/jekyll_picture_tag/
BSD 3-Clause "New" or "Revised" License
620 stars 103 forks source link

JPG Quality Setting? #32

Closed patrickcate closed 5 years ago

patrickcate commented 10 years ago

I don't know if I'm missing something, but is there an option to set the JPG quality of the generated files?

robwierzbowski commented 10 years ago

There is not! Maybe we should expose mini magic quality/compression arguments in config.

On Monday, March 3, 2014, PatrickC8t notifications@github.com wrote:

I don't know if I'm missing something, but is there an option to set the JPG quality of the generated files?

Reply to this email directly or view it on GitHubhttps://github.com/robwierzbowski/jekyll-picture-tag/issues/32 .

Rob Wierzbowski @robwierzbowski http://twitter.com/#!/robwierzbowski http://github.com/robwierzbowski http://robwierzbowski.com

patrickcate commented 10 years ago

It would certainly be useful, particular since hidpi images typically can get away with greater compression: http://www.netvlies.nl/blog/design-interactie/retina-revolution

robwierzbowski commented 10 years ago

Possibility for 2.0.

thawn commented 9 years ago

What are the currently used quality settings for jpeg images?

ChrisChinchilla commented 9 years ago

Seconded.

@robwierzbowski I would be happy to help with this as I need better quality for a project I'm working on. If you could point me in the direction of where you set quality I will attempt to add the functionality.

btobolaski commented 8 years ago

One problem is that we don't actually set it. These are the only options that we pass to imagemagick https://github.com/robwierzbowski/jekyll-picture-tag/blob/ae4307b193a2c48d445a08ca0b9fd472a7060c4f/lib/jekyll-picture-tag.rb#L240-L244

jsanne commented 8 years ago

Hi all, I found the follwing information: https://coderwall.com/p/ryzmaa/use-imagemagick-to-create-optimised-and-progressive-jpgs

Then I tried a quick and dirty hack by adding the two options i.quality and i.sharpen with hard coded values to the code:

        # Scale and crop
        image.combine_options do |i|
          i.quality "75"
          i.sharpen "0x2.5"
          i.resize "#{gen_width}x#{gen_height}^"
          i.gravity "center"
          i.crop "#{gen_width}x#{gen_height}+0+0"
        end

It works for me, but a better solution would be to use variables instead, but I don't know how to implement it. @robwierzbowski Would it be possible to expose these arguments in the config? That would be great.

ChrisChinchilla commented 8 years ago

@jsanne @robwierzbowski I think I have a rough idea of how this could be done as the plugin is already pulling in some settings from the config file.

I will have a go at this, but not certain when that will be ;)