Skip to content

2. Computer Aided design

This week I worked on evaluating and selecting 2D and 3D software. I also work out a progress to reduce the size of the images and videos in my documents.

3D Design Tool - Fusion 360

I have been using Fusion 360 for over 6 years. The main reason I choose this is because I can do all necessary thing in one app. Such as Rendering for idea sharing, CAM output for CNC, even recently added PCB design function.

Demonstration

To demostrate the major function of Fusion 360, I choose this 3-pieces puzzle found on Internet.

Create Project

Create Sketch

Create Components

2D Design Tool - CorelDRAW

CorelDRAW is user-friendly. I can simply drag different shapes from the tool box on left hand side and change their dimensions when needed. Color and other properties such as line width, line type,

I use CorelDRAW to design a draft poster of my Final Project. This draft gives me a clear idea of what to do in my FP.

Image Compression

Current problem

At most of the time I will use Snipping Tool to capture my computer screent. Because it’s really convinence. I can call it by pressing Shift+Win+S key on the keyboard, then select the way I want to capture the screen. Then the image will copy to my clipboard. I can then add remarks and save the image to my disk by pressing the popped up notification. But the problem is the Snipping Tool can only save PNG files, which is good for quality but the file size is relatively larger than JPG format. Because size matters in FabAcademy. I have to work out a process to convert PNG files in bulk to JPG format in order to reduce my upload size.

Image Compression

The instructor recommends Imagemagik to convert and compress images.

Installation

Download Imagemagik Windows Binary Release on the above website. There is nothing special during the installation, just press the next button until the end. I did not change the selective options during the progress.

Test

To test whether ImageMagick is successfully installed and could be called by the terminal. I opened Windows Terminal by pressing Win+X then press A. I typed magick.exe, an error message by ImageMagick saying that I did not input enough argument was shown. It’s ok because I just wanted to make sure ImageMagick works. Please be noted, you should type magick to call the program instead of typing its full name like imagemagick or something else.

The Conversion Script

In order to convert multiple PNG files to JPG in one step, with reference to this page, I wrote a batch file (script) to do this.

Here is the code:

@echo off
setlocal
echo converting PNGs to JPGs file...
magick mogrify -format jpg -quality 50 *.png
:PROMPT
SET /P DELETE=Conversion done, delete all PNG files (Y/[N])?
IF /I "%DELETE%" NEQ "Y" GOTO END

del *.png

:END
endlocal

The following command calls ImageMagick prorgam and converts all PNG images to JPG format with the same name but .jpg extension. The JPG quality set here is 50 percent. With higher number comes higher quality and file size. 50 percent is acceptable for me. This command will not remove the original PNG files.

magick mogrify -format jpg -quality 50 *.png

At the end, the terminal will prompt a message to ask if delete the PNG files. If I am sure the converted JPG files are fine, I will input Y and hit Enter, the terminal will help me delete all PNG files. If I want to do it myself, I could leave it empty or just close the window.

:PROMPT
SET /P DELETE=Conversion done, delete all PNG files (Y/[N])?
IF /I "%DELETE%" NEQ "Y" GOTO END

del *.png

:END

Here is how it looks like in execuation: I converted the PNG files of my week02 assignment. It reduces about half the size of them. And it cleared my original PNG files after I input Y to the terminal.

The last thing I would say about this script: it is not necessary to move the script to the image folder for the conversion. Just drag one of the PNG file to the batch file, then the terminal will set the path to the folder containin that PNG file and do the remaining jobs.

Original Files

References


Last update: June 26, 2022