Using PageSpeed/PngOut to Compress JPG/PNG with mouse clicks

Knowledge Base, System Integrator No Comments »

Nobody cares to compress raster image like jpg before sending over the email, as it’s widely known that those raster images are well compressed and can’t be compressed any further by any file compress utility even using the powerful 7zip. It’s true that file compress utilities can’t do any good to raster images but simply adding unnecessary steps for email recipient to un-compress before viewing, or worse, making the file size even bigger.

However, there are utilities that specially designed to compress raster images. First is pngout.exe for png format and second is pagespeed_optimize_image.exe for jpg format. Its download rate is surprisingly low after uploaded since Apr 21, 2010, only 770 downloads as of time of writing at Jun 14, 2011. Yes, not many people know that jpg file can be further compressed, at least slightly. The good news is they both are free, but the bad news is they both are command line utilities that require lots of key strokes to make it work. And the filename for pagespeed_optimize_image.exe itself seems need to be optimized? Anyway this article will show the way to integrate Windows Context Menu so compressing these images is a just a matter of right click away.

Context Menu for Image Compression

Associating a command for right click’s ‘Context Menu’ with certain file type can be done via Windows File Explorer, click on “Tools” and browse for “Folder Options …” then you will get the “Folder Options” popup. Click on File Types tab. Then associate the targeted file type with desired action. The steps are illustrated in this Command line association except that we are going to associate the action with image compression utility. For now we shall download pngout.exe and pagespeed_optimize_image.exe and store both of them into “My Picture” folder before we proceed further.

Page Speed Image Optimizer

Google Page Speed documentation implies that the optimization uses loss-less compression technique(s), although we could not point out the quality difference between before and after compression, but we need to alert user that it will definitely remove image meta data like IPTC or EXIF info. So be careful before performing any batch operation if you want to keep the camera information intack.

Continue from “Folder Options” pop up, clicking on “File types” tab, browse for *.JPG file type and click on “Advanced” button shall lead to another “Edit File Type” small pop up. We can see that by default there are two actions associated to it, namely “Open” and “PrintTo”. We are going to add one “New” action calls “Optimize”.

Click on “New” will invoke another small pop up which allows user to enter the Action name for display at Context Menu. And also the command line that shall execute upon action. Enter “Optimize” into Action field and copy and paste the following command line into the “Application…” field:


"C:\Documents and Settings\Administrator\My Documents\My Pictures\pagespeed_optimize_image.exe" "%1" "%1"

PNGOUT

Since PNG format is a loss-less format, so optimizing the file format also must conform to this principle. And PNGOUT can do this work very well, although it takes a little longer to compress since it needs to try out all possible strategies in compressing the targeted png file.

We just need to repeat the whole steps like above after browsing for PNG file type, and enter the following command line into the “Application…” field:


"C:\Documents and Settings\Administrator\My Documents\My Pictures\pngout.exe" "%1"

Conclusion

The result is a pretty friendly working environment, you may now right click on either JPG or PNG files to optimize the images, or even highlight a few of them before clicking optimize to perform batch operation… What?!! you can’t find the File Types tab? and you are Vista or Seven user? hmm… Microsoft wasn’t too kind to you, but you are lucky today as you can download this free utility that requires no installation that can do the file type association job like above.

And what if you need to keep the original copy? you can create another extra action call “Optimize As”, where the command line for Page Speed is:


"C:\Documents and Settings\Administrator\My Documents\My Pictures\pagespeed_optimize_image.exe" "%1" "%1.min.jpg"

and the command line for PNGOUT is:


"C:\Documents and Settings\Administrator\My Documents\My Pictures\pngout.exe" "%1" "%1.min.png"

The output filename is a little cumbersome but it does the work. Last tips: you can do a triple click on the command line to highlight them for copying. Let us know by posting a reply if you have more requirments or tips.

Share

How to Get Faster Response from Technical Support

Knowledge Base, System Integrator No Comments »

When you encounter any problem during development, there are few things that you could do to elaborate your problem before contacting technical support. One is producing screenshots, second is to reproduce the problem in a new project and send the test case over.

There are advantages by attempting to reproduce the problem in a new project or test case:

  • You may find that the new project is working but not your existing project so either you or others can check out the differences.
  • You might end up find out the solution by yourself while trying to reproduce the problem.
  • You can remember the steps better, and figure out what exactly causing the problem and describe only the necessary steps to technical support.
  • The newly created project is normally smaller hence easier to send as email attachment.
  • You don’t have to send out the existing project which might contain P&C information and hence protect your privacy.

Project or test case needs to be compressed and send as email attachment, but it’s not quite possible if the project zip archive contain any *.exe or *.js files as it may be blocked by many types of mail server. Fortunately this can be easily circumvent by using 7zip format instead, 7zip compression format is highly recommended not only it can bypass gmail server checking (as of time of writing) but also produces very much smaller compressed archive, it could be as much as 3x smaller in certain targeted source file type when comparing ordinary *.zip to *.7z file format.

In any case that the compressed file archive could not pass through the mail server, the best practice is to add a disabled extension to the exiting file. For instance, project.zip shall be renamed to project.zip.dsb, or simply add a trailing underscore at the end project.zip_ or project.7z_ for 7zip format.

One of the good thing about 7zip is it doesn’t need to know the compression file format based on the file extension in order to extract. So the mail recipient (support team) doesn’t even need to put back the correct extension before extracting the email attachment. Oh yes, 7zip program is one of the must have utility that also works with many other common compression formats like zip, rar, gzip, tar and etc.

7-zip context menu extract to sub folder
Screen shot showing unknown file type (with additional underscore) can be extracted by 7zip.

Also try to describe the steps to produce the problem. Some works can be achieved with many approaches, some problems only occur in specific steps. As such clearly describe the steps in producing the problem is important.

Last but not least, please specify the expected outcome, avoid to use ambiguous terms like “the outcome is unpredictable”, “the result is screwy”, spell out what was predicted, describe what’s the expected behavior.

Share

Optimize Inkscape SVG files

Knowledge Base, sage, System Integrator No Comments »

SVG graphic files that produced by Inkscape can be further optimized by removing some editing data and spaces which will be ignored by or have less impact to the targeted medium, most of the time, browsers. Now you may do that easily by choosing “Optimized SVG” file type upon “Save As” (Ctrl+Shift+S).

Another pop up will be prompted for user to choose what to be optimized or even compromised. The options should be chosen and tested according to what have been used, but one option that you should *not* choose is the “Enable viewboxing” which will disturb image sizing/positioning for browsers. Our brief tests also show that the precision should not go less than 3. The last option for Indent should always set to ‘None’ since nobody will care to hand code SVG file as Inkscape has done a lovely job for us.

The original SVG file which is optimized should be saved as another file and not to replace the original file. Optimization should only be done before deployment, because optimized file should not be edited as saving it directly (Ctrl+S) will put back all configuration data which was considered redundant to the targeted agent, in most contexts referring to browsers. Also, if you haven’t known, you should only remove old and unused effect/filter by clicking “Vacuum Defs” before deployment.

Do post a reply if you have more tips in optimizing SVG files.

Share

Engineering Unit or Symbol for HTML based SCADA Report

Knowledge Base, System Integrator No Comments »

User often need to add engineering unit into report. Most user tends to use old day’s method to write unit when working environment is constrained to traditional SCADA. For instance degree Celsius is being written as “degC”, meter cube being written as “m3″. This is no longer needed for modern reporting system.

Putting proper unit or symbol into HTML is natively supported and can be easily accomplished. What could do the job is HTML Character Entity Reference that having the following format &name;. It always starts by ampersand character (&) and ends by semicolon (;). For instance, to type degree symbol (°) just enter “°”, to show Superscript 3 (³) then enter “³”. More commonly used engineering unit or symbol can be found at comprehensive list of entity in Wikipedia.

SCADA report layout

A report layout that showing actual unit symbol

Share

$elf $atisfaction

System Integrator No Comments »

It’s not arguable that we all work for money, but on top of that, we may work for self-satisfaction. It’s not healthy if we work without getting self-satisfaction, it’s even worst if we work for others’ satisfaction as it’s unlikely that you will like your job. It’s important that you like your job and colleagues, because most of your time that awake is on your job with colleagues rather than on personal events with your friends or family.

In technical field like project engineering or programming, some people get satisfaction when they manage to make things work faster or efficiently, they will truly feel great when half of the size or code could perform the same task, let alone if it’s even faster. Some get excited when they acquired and utilized new/advanced knowledge or technologies. Some enjoy doing architecture/design with large scale project. And some get delighted with impressive mimic screens or enticing GUI. For any reason they could find way to have fun on their own and share with colleagues or public via blog.

On the other hand, they may get pressure from their sales department, to them these technical improvement done by one bunch of nerds is meaningless, all they concern is the sales target. They may be even go further stretching their ego to think that sales department is the one sustaining the company. It’s understandable that all their concern is sales as that’s the only mean for them to measure success especially from boss’ perspective. And it’s totally natural for sales personnel for them to be money oriented, after all, even the technical guys are all work for money, unless s/he is rich.

Technical guys need to be sales oriented so that when conflict arise, put sales into priority, make all decision in favor of sales after all it’s sales that drive the whole company. Technical fun should be carried out after one project is delivered, or in the initial stage of the project, not at the end when deadline or critical milestone is approaching.

Conversely sales personnel need to understand that what’s driving technical personnel on top of money. They will definitely find the job irksome if all they do is duplicating what they have done or taking order/instruction from the sales department, unless the remuneration is exceptionally high. Otherwise, without engineering product, there’s nothing to sell anyway. Being understood of both sides of concern, it becomes crucial to strike the balance between the different world of ying and yang to achieve $elf-$atisfaction.

Share

Designed by j david macor.com.Original WP Theme & Icons by N.Design Studio; Modified by ecava.