Friday, September 30, 2022

Presentation to Image Converter

This article explains how to convert PPT/ Impress (Libreoffice) presentation file(s) to JPG Image(s) in a *NIX (Ubuntu) environment. Presentation file can be made up of several (N) slides which after final conversion yields one JPG image per slide (N JPG files).

Prerequisites software:

  • libreoffice
  • pdftoppm

 Conversion Process:

   PPT            --->     PDF           ----> JPG

   (N-slides)          (N-pages)          ----> JPG

                                                           .....

                                                              ----> JPG (N-JPG files, one per slide)

Steps to Convert

1. Convert PPT file to PDF

$ libreoffice --convert-to pdf "fileName.ppt" --outdir "outputFolderName"

(Note: For the given input file name fileName.ppt, this script creates an output file fileName.pdf in the specified outdir.)

2. Convert PDF to JPG

$ pdftoppm -jpeg -r 200 "outputFolderName/fileName.pdf" "imagePrefix_"

(Note: Image prefix is a text that can be added to the image file names.)

Finally, these steps are put to a shell script to allow it to convert all Presentations newly added to a folder inside called "PRESENTATIONS/Active/" in the user's Home folder.

Sunday, February 20, 2022

OCR

Tesseract that "quirky command-line tool that does an outstanding job" (credit A. Kay) truly works well.  Give it a shot whenever you get the opportunity.

Sample commands for ref:

  •    tesseract IMG-1.jpg IMG-1 --psm 4
  •    tesseract -l eng IMG-2.jpg b1


Monday, January 10, 2022

Water Crisis

At a time when major cities across India like Bangalore and Delhi are experiencing a major water crisis, critical interventions are the need of the hour. For what could work one should look at fellow nation South Africa for their handling the Day Zero crisis. The day when there is no more portable water available for use by the citizen. Here's some related coverage "Day Zero: Where Next?" (https://www.nationalgeographic.com/science/article/partner-content-south-africa-danger-of-running-out-of-water) & "Bengaluru is dying of thirst because it’s drinking its own Kool-Aid" (https://the-ken.com/the-nutgraf/bengaluru-is-dying-of-thirst-because-its-drinking-its-own-kool-aid/).

Reverse Osmosis (RO) water purifiers are both a boon & bane for the average household. Whith supply water TDS remaining way way above the palatable levels, ordinary non-RO basic filteration machines are rendered useless. But then RO machines end up throwing away waste water to the levels of about 5 - 10 litres (depending upon various factors) for every litre of drinking water purified. A criminal waste of the precious resource!


RO Water Recycling Bucket


Now we've been recycling the RO Waste water for other household cleaning, watering, etc purposes. This process might take you back in time to the days of filling up buckets of water from the supply line (a reality for many to this day), well, etc for use. Though a bit cumbersome this recycling bit works. In a span of one day we may be able to collect about 2 - 3 buckets (30 - 40 litres) of water which would otherwise have gone down the drain. All said and done, it's well worth the effort!