@@ -10,7 +10,8 @@ If you used nip2, there's a [nip4 for nip2
10
10
users] ( https://www.libvips.org/2025/03/12/nip4-for-nip2-users.html ) post
11
11
which runs though the main differences.
12
12
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.
14
15
15
16
## Background
16
17
@@ -51,27 +52,27 @@ cells in the workspace and watch pixels change as you edit the formula.
51
52
52
53
The whole systems is lazy and demand-driven. You can load enormous images
53
54
(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
55
56
save operation, it will take a while, of course.
56
57
57
58
nip4 comes with a separate program called ` nip4-batch ` . This is a batch-mode
58
59
processor that can load nip4 workspace files and execute them on a set of
59
60
inputs. You can use to apply a workspace you've developed in nip4 to a big
60
- library of data .
61
+ collection of images .
61
62
62
63
## The main window
63
64
64
65
When you start nip4, it looks something like this. I've loaded a test image
65
66
(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 ` ):
67
68
68
69
![ nip4] ({{ site.baseurl }}/assets/images/nip4-main-window.png)
69
70
70
71
` A ` is the current column, ` A1 ` is a row for the image you loaded, this is all
71
72
in ` tab1 ` . The thing down the left is the set of loaded toolkits.
72
73
73
74
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
75
76
click in the magnifying glass at the top and search for tools by keyword.
76
77
77
78
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
82
83
in the current column. If you want to apply a tool to a row other than the
83
84
bottom one, select it first by clicking on the row label.
84
85
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 ,
86
87
you'll see the cell formula:
87
88
88
89
![ 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
99
100
scale widget called ` A3 ` to the workspace. Now edit the formula to be
100
101
` A3 - A1 ` and try dragging the slider.
101
102
102
- ![ nip4] ({{ site.baseurl }}/assets/images/nip4-scale.png)
103
-
104
103
It looks a bit awkward with the result row ` A2 ` positioned before the scale.
105
104
You can reorder columns by dragging on the row label.
106
105
106
+ ![ nip4] ({{ site.baseurl }}/assets/images/nip4-scale.png)
107
+
107
108
You can enter new formula in the text box at the bottom of the column.
108
109
Solarisation is a photographic technique where bright areas of the image
109
110
become inverted.
110
111
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:
117
119
118
120
![ nip4] ({{ site.baseurl }}/assets/images/nip4-duplicate.png)
119
121
@@ -123,12 +125,12 @@ Now in the text box at the bottom of column `B`, enter the formula:
123
125
if B1 < B2 then 255 * B1 / B2 else 255 * (255 - B1) / (255 - B2)
124
126
```
125
127
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.
127
129
This operation is also in the standard toolkits, next to Photographic
128
130
Negative.
129
131
130
132
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
132
134
in and watch the values of individual pixels change as you edit formula.
133
135
134
136
![ nip4] ({{ site.baseurl }}/assets/images/nip4-solarise.png)
@@ -167,10 +169,10 @@ The nip4 image view window has a lot of useful shortcuts.
167
169
* F11 fullscreen
168
170
169
171
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.
174
176
175
177
![ nip4] ({{ site.baseurl }}/assets/images/nip4-image-window.png)
176
178
0 commit comments