Are Lossless EPS Transformations Supported?
After doing some testing, I'm not sure how to get EPS files resized and converted without losing quality.
With an SVG, I can do a resize and format conversion with the output file being completely crisp and sharp. It doesn't seem to matter whether I export to JPG, PNG, etc. The file still looks great.
When I try the same thing on an EPS file, it seems like the EPS is rasterized before any transformations are applied, and the output file looks bad if upsized significantly. I've also tried chaining transformations with no success.
Increasing the Density value to 300 DPI seems to help in limited cases, but it's still clear that the resizing transformations are not being applied to the original vector file.
Are vector-based transformations supported for EPS files?
-
Hi Warren,
With some exceptions, most of the transformation options we support are available for raster images, not vector, so the first step when working with a vector image is to convert it to a raster image implicitly.Depending on the output size you require for the final output, this can mean that the image is rasterized 'too small'; In general, we recommend that you start with a relatively large image, perform the transformation options you need, then adjust the size down to the required output size. For vector images specifically, as you noticed, the use of the `dn` parameter to set the density at which we perform the rasterization can solve a lot of these issues by creating a very large raster image before the other options are performed, so I recommend continuing with that.
If you have some specific examples you can share either here or in a support request we'd be happy to take a look and give more specific advice for those exact images, but overall, what I said above is best - start with a large image before performing other transformations to minimise the negative effects of making it smaller before delivery.Thanks,
Stephen
-
Hi Stephen, and thank you for your reply.
I have two versions of a test image uploaded, one in SVG and one in EPS (original was an EPS, which I converted to SVG in Illustrator for the comparison).
SVG: https://res.cloudinary.com/ocimages/image/upload/v1572291872/icon%20test/Icon_Rebar_RGB_b8krpl.svg
EPS: https://res.cloudinary.com/ocimages/image/upload/v1572291386/icon%20test/Icon_Rebar_RGB_geykvc.eps
Here is the image at its default size when just transformed by Cloudinary from an EPS to a JPG. As you can see, it's pretty small.
https://res.cloudinary.com/ocimages/image/upload/v1572291386/icon%20test/Icon_Rebar_RGB_geykvc.jpgAnd now we have this same image upscaled to 1500px wide, again from the EPS and output as a JPG:
You'll notice that it looks pretty bad.
Here is the image with the same transformations -- upscaled to 1500px and output as JPG. The only difference being that this time we're using the SVG as the source image.This time it's perfectly crisp and sharp.
Even upscaling to 5000px wide results in no apparent loss of quality.
Note that I haven't messed with the 'dn' parameter at all in this test.
Now, while I can't definitively say what the technology differences are in the respective transformations here, it certainly does appear that the scale transformation is happening in vector-land for the SVG, while the EPS is being rasterized prior to upscaling.
The main question I'm trying to get answered is whether there's any combination of settings in Cloudinary that will treat EPS files the same way SVGs are treated -- upscaling without massive quality loss, as is the common traditional expectation with vector-based images.
If not, we can work around it. But it would be ideal if we could just work with our source EPS files rather than manually converting them to SVG prior to putting them into Cloudinary.
Thank you -
Hi Warren,
Looking at those examples, the original .EPS seems to be quite small. Or rather, given it's a vector image, its metadata tells us it's quite small.
When I open it on my local machine, Mac OS's Preview app converts it to a PDF and it's shown at about 180x180 pixels and the info pane indicates that it's to be shown at "0.67 × 0.67 inches":
I'm afraid I don't have software on my machine to edit the EPS, but when you're saving it, is the page size or density configurable?
Overriding the density/DPI when rasterizing as part of our transformations can give a better result, but for this example, even 300 dpi provides quite a small raster image:
https://res.cloudinary.com/ocimages/image/upload/dn_300/v1572291386/icon%20test/Icon_Rebar_RGB_geykvc.jpgFor SVGs, we do indeed have more support than for other vector formats, which is why more of the operations (notably scaling) can be performed before rasterization, but we should be able to get a better result for you here also
Thanks,
Stephen
Please sign in to leave a comment.
Comments
5 comments