@@ -921,20 +921,22 @@ two orders of magnitude smaller than the bitmap version.
921
921
## Comparing lossless versus lossy compression (optional, not included in timing)
922
922
923
923
Let us see a hands-on example of lossless versus lossy compression.
924
- Once again, open a terminal and navigate to the ` data/ ` directory.
924
+ Open a terminal (or Windows PowerShell) and navigate to the ` data/ ` directory.
925
925
The two output images, ` ws.bmp ` and ` ws.jpg ` , should still be in the directory,
926
926
along with another image, ` tree.jpg ` .
927
927
928
928
We can apply lossless compression to any file by using the ` zip ` command.
929
929
Recall that the ` ws.bmp ` file contains 75,000,054 bytes.
930
930
Apply lossless compression to this image by executing the following command:
931
- ` zip ws.zip ws.bmp ` .
931
+ ` zip ws.zip ws.bmp `
932
+ (` Compress-Archive ws.bmp ws.zip ` with PowerShell).
932
933
This command tells the computer to create a new compressed file,
933
934
` ws.zip ` , from the original bitmap image.
934
- Execute a similar command on the tree JPEG file: ` zip tree.zip tree.jpg ` .
935
+ Execute a similar command on the tree JPEG file: ` zip tree.zip tree.jpg `
936
+ (` Compress-Archive tree.jpg tree.zip ` with PowerShell).
935
937
936
938
Having created the compressed file,
937
- use the ` ls -al ` command to display the contents of the directory.
939
+ use the ` ls -l ` command ( ` dir ` with PowerShell) to display the contents of the directory.
938
940
How big are the compressed files?
939
941
How do those compare to the size of ` ws.bmp ` and ` tree.jpg ` ?
940
942
What can you conclude from the relative sizes?
0 commit comments