@@ -881,20 +881,22 @@ two orders of magnitude smaller than the bitmap version.
881
881
## Comparing lossless versus lossy compression (optional, not included in timing)
882
882
883
883
Let us see a hands-on example of lossless versus lossy compression.
884
- Once again, open a terminal and navigate to the ` data/ ` directory.
884
+ Open a terminal (or Windows PowerShell) and navigate to the ` data/ ` directory.
885
885
The two output images, ` ws.bmp ` and ` ws.jpg ` , should still be in the directory,
886
886
along with another image, ` tree.jpg ` .
887
887
888
888
We can apply lossless compression to any file by using the ` zip ` command.
889
889
Recall that the ` ws.bmp ` file contains 75,000,054 bytes.
890
890
Apply lossless compression to this image by executing the following command:
891
- ` zip ws.zip ws.bmp ` .
891
+ ` zip ws.zip ws.bmp `
892
+ (` Compress-Archive ws.bmp ws.zip ` with PowerShell).
892
893
This command tells the computer to create a new compressed file,
893
894
` ws.zip ` , from the original bitmap image.
894
- Execute a similar command on the tree JPEG file: ` zip tree.zip tree.jpg ` .
895
+ Execute a similar command on the tree JPEG file: ` zip tree.zip tree.jpg `
896
+ (` Compress-Archive tree.jpg jpg.zip ` with PowerShell).
895
897
896
898
Having created the compressed file,
897
- use the ` ls -al ` command to display the contents of the directory.
899
+ use the ` ls -al ` command ( ` dir ` with PowerShell) to display the contents of the directory.
898
900
How big are the compressed files?
899
901
How do those compare to the size of ` ws.bmp ` and ` tree.jpg ` ?
900
902
What can you conclude from the relative sizes?
0 commit comments