I know the WP Image Editor is not meant to upsize images, gives a WP_Error if you try, and any time you upsize an image you lose quality - but as mentioned in their source code you can use the 'image_resize_dimensions' filter to force it to scale up if a particular image application is required to be a certain size.

The problem I'm having is that any upscaling done by Imagemagick in this case is actually much worse than just zooming in the browser - Here's a really upscaled, really pixelated example just to show what I mean:

Browser screenshot showing zoom in on original image, not too bad: Browser ok image

Result of upscale with wp image editor ->resize, looks super pixelated: Ugly upsize

Is there a way to get WP image editor/Imagemagick to not upsize images in such a way that the pixellation is so obvious?

  • Use CSS to upscale via the "background-size" property. Also note WordPress has this too: make.wordpress.org/core/2015/11/10/… – Nathan Powell Jan 20 '16 at 8:24
  • @NathanPowell Thanks, I know about responsive images in WP4.4 - how would that help with this? A css solution doesn't help where I'm required to have a certain WidthxHeight pixel image! – NoBugs Jan 22 '16 at 3:11
  • Sorry, I totally disregarded your question. To help with a solution can you explain why you are trying to upscale rather than zoom? Up scaling images in Photoshop is even a science with many variables, so I don't think doing this can solve your problem. With CSS you can force an image back size minimum height and width. The image can be auto generated in WordPress at a smaller scale if it doesn't meet the minimum criteria, then viola, you have a small image zoomed to fit your box. – Nathan Powell Jan 22 '16 at 3:29
  • @NathanPowell CSS doesn't help when image is provided to a system that requires WxH pixel image. – NoBugs Jan 22 '16 at 21:09
  • What is the intended resulting code? Is it a problem to change the markup where the images are rendered? – Nathan Powell Jan 22 '16 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.