I am automating conversion of source PNG images to JPEGs of a predefined dimension. For most the images, I don't need to provide the sampling-factor and happy with the output quality and file size. However, a few of the files get heavily distorted with artifacts. For such files, I currently manually provide the option '-sampling-factor 1x1' to get the desired output jpeg, though bigger file size.
Is there an way to identify before hand which PNG src file needs the usage of sampling-factor for conversion? That will help to pull it in the script.
Related
I am currently testing magickSlicer for converting large jpeg files to DZI. It works nice.
However, i am facing a problem with the size of rendered DZI. For exemple, for an orginal jpeg file weighting 10Mo, the rendred DZI folder weight 26.2Mo with default option (-w 256 -h 256).
If I change options width and height to 512x512 the DZI folder weight 18.3Mo. It is yet too big because I have to deal with a huge repository of large files.
I wish to know how can I manage options of conversion for getting a DZI folder weighting less or equals to the weight of original files.
Best regards.
You might be able to change the image quality (to make the JPEG files smaller) by playing with the --options command line argument:
https://github.com/VoidVolker/MagickSlicer#--p---options-imagemagick-options-string-
You'll have to look at the ImageMagick command line options to find the right value:
http://imagemagick.org/script/command-line-processing.php#option
That said, because DZI contains a pyramid of tiles, you are making more pixels than you started with. To be precise, you're ending up with 1.333 times as many pixels. All other things (like image quality settings) being equal, for your 10MB file you should end up with a 13MB set of tiles.
New to Juypter, trying to use it with Latex. Everything works fine except for the images. I used this tutorial: https://www.youtube.com/watch?v=m3o1KXA1Rjk&t=149s
Png Images are fine in markdown, i.e
But LaTex cannot determine size of png images. If I save the image as pdf I get the same issue. If I save the image as eps then LaTex complains that it cannot convert eps to pdf.
Has anyone had this issue? Anyone know how to solve it?
PNG images always contain the size in pixels.
Optionally, they can include a chunk of data named pHYs. This contains the resolution of the image. If this chuck is present, you should be able to find the actual text pHYs in the file.
If this chunk is missing from the PNG file, the scale of the image can not be found.
If you are on a UNIX-like operating system you could use grep or hexdump to check for the text pHYs in the PNG file. The identify program from the ImageMagick suite also can display the resolution of PNG images.
Note that there is an error in the video. The author first uses latex and then pdflatex three times. That is not a good idea, since they have different capabilities w.r.t. graphics. Stick with pdflatex.
I need to edit a png image,by giving it border and drop shadow effect. But the final size of the edited image is too high to use for a mobile app .I know that size of jpeg is less compared to that of png.So i convert that image to jpeg and tried to give drop shadow and border effect.But that image is not having transparent background..Is their any other methods to accomplish this using jpeg?
Another option is to try either ImageOptim for losseless compression, or its lossy cousin, ImageAlpha.
ImageOptim tries a series of lossless algorithms to shrink a PNG and selects the smallest result of the bunch. It has taken 25% to 50%+ of quite a few of our images.
ImageAlpha, on the other hand, is lossy and can further crunch the image, with results more like JPEG but without losing Alpha.
You would also do well to disable PNG compression in Xcode as shown here, with additional details here.
What #minitech wanted to say is not about scaling, it's about file compression. jpg and png files usually have some data that could be removed from the file. There are some compression methods to reduce file size (note that is size in kbs, not in scale measurement). Jpg images can reduce file size by reducing image quality, too.
If you want another file type that accepts transparency, there are the gif format, which gives you a smaller file, but have some drawbacks, like a lack of alpha channel (variable transparency). Check this link for more details: http://www.w3.org/QA/Tips/png-gif
There are a couple of online file compressors. If you want to compress png files, you could try using http://tinypng.org/
No, jpeg image wont support transparency.But you can change the white background coming along with jpeg image
I have an app that have a LOT of images (some are in jpeg, others in PNG).
This image must be in bundle because the app need to run offline.
I tried to zip the images but does not make much diference.
I was thinking in compressing the images, but since they have different types will be a lot of work do decode then beside they can't lost quality.
My app has 300mb.
Any ideas ?
EDIT
Those images are from are downloaded by a script, my app have an embed sqlite (make by a script too) mapping then.
Most of then are pictures with 600x600 approach.
JPEG and PNG images are already compressed. Trying to compress them further won't help significantly; it'll just make your application more complicated, and make it take longer to display the images.
Converting PNG images to JPEG, where appropriate, or compressing JPEG images at a lower quality setting, may save you a considerable amount of space.
Server Config:
Windows Server 2003
IIS 6
ColdFusion 8 Standard Edition
Java Version 6 Update 18
I have a ColdFusion application that allows users to upload images that will be added to an existing PDF. When the images are added to the PDF, they have to fit within a minimum/maximum height and width, so the uploaded image needs to be scaled to fit.
For instance, let's say the minimum height and width for a given image is 100x100, and the maximum height and width is 200x200, and the user uploads an image that is 500x1000. I use the logic below to scale that image down without skewing the image (it keeps its original shape) to 100x200. For an image smaller than the minimum, it is scaled up (in the example above, a 50x50 image would be scaled up to 100x100).
Unfortunately, I'm running into a lot of problems with users uploading "invalid images". I know that ColdFusion has problems working with Progressive JPEGs and CMYK JPEGs, but even some TIFFs are throwing errors. Also, a 3MB TIFF image takes over a minute to scale (not to mention the loss of resolution that occurs, which I have submitted as a separate question here.)
I've added logic to prevent ColdFusion from trying to process an "invalid image" by using the IsImageFile() function, but the users are very frustrated when they have an image that they can open and view on their PC, but we can't accept it. Do online print companies (i.e. Shutterfly, Kodak, etc.) have these issues? I can't remember ever having an issue on these websites (though I know they may not necessarily use ColdFusion).
Any thoughts on what I can do to allow more types of images to be used (Progressive, CMYK, etc.) and improve performance?
You will likely have to use a non-CF solution like we had to do before CF8. Some libraries mentioned here: https://stackoverflow.com/questions/158756/what-is-the-best-image-manipulation-library
Scaling time is heavily dependent on the algorithm you chose to use. Adding images to PDFs in ColdFusion is unpredictable at best. I found them to be often inflated, dramatically increasing the PDF file size.
Here is some information from the docs:
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_in-k_16.html
Supported image file formats
The cfimage tag operates on a number of different file formats. To list the formats that are supported on the server where the ColdFusion application is deployed, use the GetReadableImageFormats function and the GetWriteableImageFormats function.
ColdFusion supports the following default image formats on Macintosh, Windows, and Unix operating systems:
JPEG
GIF
TIFF
PNG
BMP
ColdFusion does not support the following image formats:
Animated GIF
Multipage TIFF
PSD
AI
CMYK support
The cfimage tag supports reading and writing CMYK images, but does not support actions that require converting the images. For example, you can use CMYK images with the read, write, writeToBrowser, resize, rotate, and info actions. You cannot use CMYK images with the convert, captcha, and border actions. The same rule applies to image functions. For example, the ImageNew, ImageRead, and ImageWrite functions support CMYK images, but the ImageAddBorder function does not.