Skip to content

Commit 88b1ad5

Browse files
committed
revise text
1 parent daad052 commit 88b1ad5

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

_posts/2025-03-20-introduction-to-nip4.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ If you used nip2, there's a [nip4 for nip2
1010
users](https://www.libvips.org/2025/03/12/nip4-for-nip2-users.html) post
1111
which runs though the main differences.
1212

13-
I'll write a "nip4 for nerds" post introducing nip4's programming language.
13+
I'll write a "nip4 for nerds" post next week introducing nip4's programming
14+
language.
1415

1516
## Background
1617

@@ -51,27 +52,27 @@ cells in the workspace and watch pixels change as you edit the formula.
5152

5253
The whole systems is lazy and demand-driven. You can load enormous images
5354
(many 100s of gigabytes) and manipulate them interactively, since only the
54-
pixels need to update the screen actually get processed. When you do a final
55+
pixels needed to update the screen actually get processed. When you do a final
5556
save operation, it will take a while, of course.
5657

5758
nip4 comes with a separate program called `nip4-batch`. This is a batch-mode
5859
processor that can load nip4 workspace files and execute them on a set of
5960
inputs. You can use to apply a workspace you've developed in nip4 to a big
60-
library of data.
61+
collection of images.
6162

6263
## The main window
6364

6465
When you start nip4, it looks something like this. I've loaded a test image
6566
(drag one in, use the folder button at the top left, or start nip4 from the
66-
command-line with `nip4 nina.jpg`):
67+
command-line with `nip4 my-great-image.jpg`):
6768

6869
![nip4]({{ site.baseurl }}/assets/images/nip4-main-window.png)
6970

7071
`A` is the current column, `A1` is a row for the image you loaded, this is all
7172
in `tab1`. The thing down the left is the set of loaded toolkits.
7273

7374
The toolkit menu contains around 300 useful operations, and you can make more
74-
yourself. You can click around to move in and out of sub-toolkits, or you can
75+
yourself. You can click to move in and out of toolkits, or you can
7576
click in the magnifying glass at the top and search for tools by keyword.
7677

7778
If you select Filter > Photographic Negative you'll see:
@@ -82,7 +83,7 @@ Most tools take one argument, and they are applied to the bottom row
8283
in the current column. If you want to apply a tool to a row other than the
8384
bottom one, select it first by clicking on the row label.
8485

85-
If you open up the row by clicking on the `V` down button next to A2,
86+
If you open up `A2` by clicking on the `V` down button next to the label,
8687
you'll see the cell formula:
8788

8889
![nip4]({{ site.baseurl }}/assets/images/nip4-formula.png)
@@ -99,21 +100,22 @@ bar to get back to the start position, then click Widgets > Scale to add a
99100
scale widget called `A3` to the workspace. Now edit the formula to be
100101
`A3 - A1` and try dragging the slider.
101102

102-
![nip4]({{ site.baseurl }}/assets/images/nip4-scale.png)
103-
104103
It looks a bit awkward with the result row `A2` positioned before the scale.
105104
You can reorder columns by dragging on the row label.
106105

106+
![nip4]({{ site.baseurl }}/assets/images/nip4-scale.png)
107+
107108
You can enter new formula in the text box at the bottom of the column.
108109
Solarisation is a photographic technique where bright areas of the image
109110
become inverted.
110111

111-
This is easy to write as a formula: first, duplicate column `A` by
112-
right-clicking on the column title and selecting Duplicate from the menu. nip4
113-
does not have an undo operation, instead it has fast and easy duplicate,
114-
merge and delete. If you make a copy of `A` before you start changing it,
115-
you can't lose any of your current work. Right-click on `B3` and selecte
116-
Delete, so you have:
112+
This is easy to write as a formula. nip4 does not have an undo operation,
113+
instead it has fast and easy duplicate, merge and delete. If you make a
114+
copy of column `A` before you start changing it, you can't lose any of your
115+
current work.
116+
117+
Duplicate column `A` by right-clicking on the column title and selecting
118+
Duplicate from the menu. Right-click on `B3` and select Delete, so you have:
117119

118120
![nip4]({{ site.baseurl }}/assets/images/nip4-duplicate.png)
119121

@@ -123,12 +125,12 @@ Now in the text box at the bottom of column `B`, enter the formula:
123125
if B1 < B2 then 255 * B1 / B2 else 255 * (255 - B1) / (255 - B2)
124126
```
125127

126-
And try dragging the slider again. Hopefully you'll see a solarised image.
128+
And try dragging scale `B2`. Hopefully you'll see a solarised image.
127129
This operation is also in the standard toolkits, next to Photographic
128130
Negative.
129131

130132
If you double-click on an image thumbnail, you'll open an image view window.
131-
These are all live, so as you drag sliders, they'll all update. You can zoom
133+
These are all live, so as you drag scales, they'll all update. You can zoom
132134
in and watch the values of individual pixels change as you edit formula.
133135

134136
![nip4]({{ site.baseurl }}/assets/images/nip4-solarise.png)
@@ -167,10 +169,10 @@ The nip4 image view window has a lot of useful shortcuts.
167169
* F11 fullscreen
168170

169171
If you select View > Display Control Bar, some widgets appear at the bottom.
170-
They let you flip pages, animation frames, set a scale and offset for each
171-
pixel (handy for scientific images), and a burger menu gives a set of useful
172-
visualisation options, such as false colour, log scale, and colour
173-
management.
172+
They let you flip pages, move to animation frames, set a scale and offset
173+
for each pixel (handy for scientific images), and a burger menu gives
174+
a set of useful visualisation options such as false colour, log scale,
175+
and colour management.
174176

175177
![nip4]({{ site.baseurl }}/assets/images/nip4-image-window.png)
176178

assets/images/nip4-scale.png

45.9 KB
Loading

0 commit comments

Comments
 (0)