What is the ligthest possible valid icon? - optimization

I aim to create the ligthest possible valid .ico file.
I have no idea where the limit is for a valid ico file.
Currently the best I could achieve is a 1x1 black .ico, which size 70 octets.
Can I do lighter? What should I do to have the lightest possible ico file?

Related

Adobe Photoshop pixels to CSS

How do I convert Adobe Photoshop points to pixels in CSS?
My font size is 48pt, how does that convert to pixels?
Also, are there tools that help convert photoshop psds into CSS/Html?
You can use points to declare the size of your text in css if you like, there's no need to convert. That way if your photoshop file is set up for 72ppi, you see the same size of font in both photoshop and web.
If you building mobile thou, sizes work differently. Than the best thing is to look for a guide, depending on which devices you're building for.
I believe there isn't a tool to convert photoshop pds into css/html. Although, Zeplin may helps. Zeplin is a tool to easily export assets and make guidelines for projects, but it also helps you create a css file from your screen. https://zeplin.io/ It's really nice!
If your Photoshop document is 72pixels per inch (the standard of the web). 1px = pt.
OSX renders 72 ppi (dpi), windows renders bitmaps at 96 ppi (dpi). Knowing the 72ppi or 96ppi numbers can help you work out what's going on.
Photoshop will alter the Text Point size depending on what the image ppi is set to.
However, with today's high pixel density displays the whole dpi to ppi is something of a fudge. Wikipedia has a good, but dated, article on pixels (screens) vs dots (print)
https://en.wikipedia.org/wiki/Dots_per_inch

Is it possible to compress only a section of an image?

I am wondering if there is any way to compress a specific sections of an image and preserve other sections. For example I want the background of a large image compressed but the title and description text laid over the background to be crisp.
This would be pretty cool. Short answer (no).
Long Answer.
JPEG and PNG.
Do the background with JPEG and save this off as a separate file.
Then do the title and description as a PNG with transparency.
In what every you are making (website, app) you will then be able to overlay these images and since the PNG has transparency it will appear as part of the original image.
At the end of the day we only have a few technologies we can work with ant that is jpg, gif, png, tiff, bmp, (svg some things dont support this) for image decoding for the end user.
Neither of these technologies do what you want well. PNG is awesome, but it the file size will be pretty huge compared to JPG. JPG wont give you crisp text when you have an image in the background.
I wouldnt be surprised if someone has written an encoder for what you want to do but being able to send this file to someone or something. They wont be able to decode it easily without your encoder and hence this is why we stick to the standard formats.
The direct answers are:
If you are asking "can I . . . . in Photoshop", the answer to your question is NO.
If you are asking "can I . . . . programmatically," the answer to your question is YES, with some compression methods.
However, I sense there is a question behind your question.
You mention blurring. That suggests you are trying to save as JPEG because JPEG is the only major image compression technique that causes blurring.
The solution to this problem depends upon the nature of the image. Is it a photograph? Drawing? How many colors does it have?
Could you use another compression method (e.g., PNG as suggested previously)?
You might be able to get away with JPEG using a so called "high" quality setting at the cost of increased file size.
You can select to save it with a format that has lossless compression, but the compression rate is significantly lower. Having said that, save your file as JPG with the highest level (12), then open the new file and compare it to the original. In this level the details loss is relatively lower and if the text isn't on a single color background you might find this acceptable to your needs.

How do I shave a few KB off a PDF?

I have a scanned greyscale PDF of a set of official school transcripts that has been compressed to 1MB. Actually, its 1023655 bytes. I am trying to upload the document to an online application that has a maximum file size of 1MB.
My attempts to further compressing the PDF via the same website have not worked.
I have tried using Neevia, but any further compression makes the lightest of the three pages completely white (the first two pages are black printed on a blue background, and third is light grey printed on a white background)
I've tried using mac preview to save as black and white (unreadable), and to resize it (blurry).
I have GIMP at my disposal, but otherwise I don't have any experience with photo or document manipulation. How do I shave those kilobytes off this PDF?
You could try looking at the bit depth of the grey scale. For example, if it's currently 16-bit grey scale (2^16, or 65536 shades of grey), you could try using an 8-bit grey scale (256 shades) or 4-bit (16 shades). You've already tried one form of this, going to 1-bit (2 shades, i. e. black and white), but without first taking a look at adjusting the contrast to make the text really stand out, you'll often end up with illegible files.
If you download and install CutePDF, you can open the PDF file and go to print it, select the CutePDF printer, and you will be prompted to save a new PDF file. Chances are this new PDF file will be much smaller,

What is the difference between .psd (photoshop) and .xcf (gimp) file types?

What are the technical specifications/capabilities of each file format?
Does one type handle certain types of graphics better than the other?
XCF supports saving each layer, the current selection, channels, transparency, paths and guides. However, unlike the native file format for Adobe Photoshop, PSD, the undo history is not saved in an XCF file.
The .PSD (Photoshop Document), Photoshop's native format, stores an image with support for most imaging options available in Photoshop. These include layers with masks, color spaces, ICC profiles, transparency, text, alpha channels and spot colors, clipping paths, and duotone settings

How does PS/PDF store and compress bitmaps?

I am experimenting with a system to scan letters and convert the scanned bitmaps to PDF with the goal to have a high resolution and a small PDF file size.
I am prototyping with scanner, GIMP for bitmap manipulation and ImageMagick for bitmap-to-PDF conversion.
My process looks as follows:
Scan in 3x8bit color, 600 DPI,
LZW-compressed true-color TIFF file
size is around 8 Mb.
Use GIMP to convert bitmap to indexed
image with a typical color table of 4
to 8 colors. That makes the image better compressible.
Use ImageMagick to convert the
LZW-compressed indexed TIFF file PDF,
with around 500K per page.
Now in order to make the image even better compressible, I could make the bitmap more compression-friendly. Before experimenting here, I would like to know how PS/PDF stores bitmaps.
Are bitmaps in PS/PDF run-lenght-encoded? Then I woud gain compression by removing single pixles form bitmap rows.
Do you have ideas for further optimizing here?
Do you know references to bitmap storage format in PS/PDF?
PDF supports many types of image compression, see: http://en.wikipedia.org/wiki/Pdf#Raster_images
I think you can specify which one to use with the imagemagick -compress option: http://www.imagemagick.org/script/command-line-options.php#compress
A few companies (Luratech and CamiNova are the only ones I know) make a "Mixed Raster Content" model in PDF. The files are viewable in the standard Adobe Reader but are very, very small -- comparable to DjVu.
"Mixed Raster Content" means they segment the image into a high resolution B&W mask (hard edges, lines, letters) and lower resolution smooth tone image (background pictures). The mask gets stored using a bitonal compression algorithm (probably JBIG2) and the smooth tone image gets compressed using JP2K (probably).
For bitmaps, IIRC, PDF uses deflate. But PDF can also store images with more specific image compression algorithms, such JPEG (lossy), CCITT (lossless), JBIG2 (lossy and lossless) and JPX (of JPEG2000, lossy and lossless).
Adobe's PDF reference might be a good place to start. From a very cursory look, it looks like images are stored uncompressed, but that doesn't feel right at all. It can also link to external images, in JPEG for instance.
The compression method is generally selected by the tool creating the PDF and you may have limited control over that.
If you have Acrobat 9.0 there is a really nice 'hidden' feature which allows you to see the object tree inside a PDF (you are interested in the XObjects under Resources). There is a short blog on using it at http://pdf.jpedal.org/java-pdf-blog/bid/10479/Viewing-PDF-objects