Skip to content

Commit

Permalink
markdown source builds
Browse files Browse the repository at this point in the history
Auto-generated via {sandpaper}
Source  : 0c8bfff
Branch  : main
Author  : Toby Hodges <[email protected]>
Time    : 2023-12-19 13:24:53 +0000
Message : Merge pull request #307 from JeremyPike/comparing-compression-windows

Comparing lossless versus lossy compression for Windows users
  • Loading branch information
actions-user committed Dec 19, 2023
1 parent c3b0ad5 commit 23ef1d9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
10 changes: 6 additions & 4 deletions 02-image-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -921,20 +921,22 @@ two orders of magnitude smaller than the bitmap version.
## Comparing lossless versus lossy compression (optional, not included in timing)

Let us see a hands-on example of lossless versus lossy compression.
Once again, open a terminal and navigate to the `data/` directory.
Open a terminal (or Windows PowerShell) and navigate to the `data/` directory.
The two output images, `ws.bmp` and `ws.jpg`, should still be in the directory,
along with another image, `tree.jpg`.

We can apply lossless compression to any file by using the `zip` command.
Recall that the `ws.bmp` file contains 75,000,054 bytes.
Apply lossless compression to this image by executing the following command:
`zip ws.zip ws.bmp`.
`zip ws.zip ws.bmp`
(`Compress-Archive ws.bmp ws.zip` with PowerShell).
This command tells the computer to create a new compressed file,
`ws.zip`, from the original bitmap image.
Execute a similar command on the tree JPEG file: `zip tree.zip tree.jpg`.
Execute a similar command on the tree JPEG file: `zip tree.zip tree.jpg`
(`Compress-Archive tree.jpg tree.zip` with PowerShell).

Having created the compressed file,
use the `ls -al` command to display the contents of the directory.
use the `ls -l` command (`dir` with PowerShell) to display the contents of the directory.
How big are the compressed files?
How do those compare to the size of `ws.bmp` and `tree.jpg`?
What can you conclude from the relative sizes?
Expand Down
6 changes: 3 additions & 3 deletions 03-skimage-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ Don't forget to use `fig, ax = plt.subplots()` so you don't overwrite
the first image with the second.
Images may appear the same size in jupyter,
but you can see the size difference by comparing the scales for each.
You can also see the differnce in file storage size on disk by
You can also see the difference in file storage size on disk by
hovering your mouse cursor over the original
and the new file in the jupyter file browser, using `ls -l` in your shell,
or the OS file browser if it is configured to show file sizes.
and the new files in the Jupyter file browser, using `ls -l` in your shell
(`dir` with Windows PowerShell), or viewing file sizes in the OS file browser if it is configured so.

::::::::::::::: solution

Expand Down
6 changes: 3 additions & 3 deletions md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"config.yaml" "101b3ac4b679126bb1f437306eb1b836" "site/built/config.yaml" "2023-04-25"
"index.md" "6e80c662708984307918adfad711e15f" "site/built/index.md" "2023-07-26"
"episodes/01-introduction.md" "9755639c515fdbf752422e2e59128f63" "site/built/01-introduction.md" "2023-07-26"
"episodes/02-image-basics.md" "b17ae758d5d8a2a81348306a97b37067" "site/built/02-image-basics.md" "2023-12-11"
"episodes/03-skimage-images.md" "e65a5d9bea4f5ee0597ac13cb0be875d" "site/built/03-skimage-images.md" "2023-12-13"
"episodes/02-image-basics.md" "6e18d2c930b9dbee94c6efef3c9a5622" "site/built/02-image-basics.md" "2023-12-19"
"episodes/03-skimage-images.md" "9a07ff5940739dd0aac79c6fc273d6b4" "site/built/03-skimage-images.md" "2023-12-19"
"episodes/04-drawing.md" "9d78a765f5e9747ffc2aa43a4a5a414d" "site/built/04-drawing.md" "2023-09-05"
"episodes/05-creating-histograms.md" "59c07192c0a6217e8a42d3e7365025f9" "site/built/05-creating-histograms.md" "2023-12-08"
"episodes/06-blurring.md" "8d109bb4c49f27f54857f6d35b4c6b9a" "site/built/06-blurring.md" "2023-12-08"
Expand All @@ -17,5 +17,5 @@
"learners/edge-detection.md" "fdbcee7436e104e6587e1cb40cd37d18" "site/built/edge-detection.md" "2023-08-16"
"learners/prereqs.md" "7ca883d3d01d18c98ce7524ed297e56c" "site/built/prereqs.md" "2023-07-26"
"learners/reference.md" "7ae9deea84007c6ed1339955ac23f4b7" "site/built/reference.md" "2023-04-26"
"learners/setup.md" "415b4d15608ca89783bafb8a90ee7a63" "site/built/setup.md" "2023-11-21"
"learners/setup.md" "7edbbef5b2cb020d40d88c9cb0dcd98f" "site/built/setup.md" "2023-12-19"
"profiles/learner-profiles.md" "60b93493cf1da06dfd63255d73854461" "site/built/learner-profiles.md" "2023-04-25"
4 changes: 4 additions & 0 deletions setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,8 @@ e.g. your Desktop or a folder you have created for using in this workshop.

:::::::::::::::::::::::::

5. A small number of exercises will require you to run commands in a terminal. Windows users should
use PowerShell for this. PowerShell is probably installed by default but if not you should
[download and install](https://apps.microsoft.com/detail/9MZ1SNWT0N5D?hl=en-eg&gl=EG) it.

[figshare-data]: https://figshare.com/articles/dataset/Data_Carpentry_Image_Processing_Data_beta_/19260677

0 comments on commit 23ef1d9

Please sign in to comment.