@munusshih/p5.export 0.1.0-beta.10 → 0.1.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # p5.export
2
2
 
3
+ <p align="center">
4
+ <img src="https://raw.githubusercontent.com/munusshih/p5.export/main/p5.export.png" alt="p5.export panel previewing an animated p5.js sketch" width="900">
5
+ </p>
6
+
3
7
  [![npm version](https://img.shields.io/npm/v/%40munusshih%2Fp5.export?logo=npm&color=cb3837)](https://www.npmjs.com/package/@munusshih/p5.export)
4
8
  [![npm downloads](https://img.shields.io/npm/dm/%40munusshih%2Fp5.export?logo=npm)](https://www.npmjs.com/package/@munusshih/p5.export)
5
9
  [![license](https://img.shields.io/npm/l/%40munusshih%2Fp5.export)](./LICENSE)
@@ -121,7 +125,13 @@ function setup() {
121
125
  ### Video (record once, export to multiple formats)
122
126
 
123
127
  ```js
124
- const buffer = createVideoBuffer({ duration: 3, fps: 30 }); // starts immediately
128
+ // Starts immediately. By default, export timing follows the rate set by
129
+ // frameRate(), so a frameRate(1) sketch remains one frame per second.
130
+ const buffer = createVideoBuffer({ duration: 3 });
131
+
132
+ // Record a sharper 2× render. Set fps only when you intentionally want to
133
+ // override the sketch's target frame rate.
134
+ const hiResBuffer = createVideoBuffer({ duration: 3, scale: 2, fps: 30 });
125
135
 
126
136
  // later, after the buffer auto-stops or you call `stopVideoBuffer()`:
127
137
  await exportVideoBuffer(buffer, { format: 'mp4', filename: 'clip' });
@@ -130,7 +140,7 @@ await exportVideoBuffer(buffer, { format: 'webp', filename: 'clip' }); // anima
130
140
  await exportVideoBuffer(buffer, { format: 'gif', filename: 'clip' });
131
141
  ```
132
142
 
133
- Frames are captured in real RGBA at the canvas's native resolution. `exportVideoBuffer()` is re-callable on the same buffer — no re-recording — so users can pick the format they want from the GUI without losing the take.
143
+ Frames are captured in real RGBA at the sketch's target frame rate. Set `scale` from 1–4 to render the recording at that pixel density instead of enlarging the encoded pixels afterward. `exportVideoBuffer()` is re-callable on the same buffer — no re-recording — so users can pick the format they want from the GUI without losing the take.
134
144
 
135
145
  You can also do a one-shot `recordVideo({ format: 'mp4', duration: 3, filename: 'clip' })` if you don't need the multi-format buffer.
136
146
 
@@ -157,7 +167,7 @@ createExportGUI({ title: 'my sketch', filename: 'artwork', collapsed: false });
157
167
  removeExportGUI();
158
168
  ```
159
169
 
160
- Drag from the header to move it. The two tabs (Image / Video) share the same compact form. The Video tab shows a low-res preview with a scrubbable timeline before you commit to encoding.
170
+ Drag from the header to move it. The two tabs (Image / Video) share the same compact form. The Video tab includes a 1×–4× recording scale and shows a low-res preview with a scrubbable timeline before you commit to encoding.
161
171
 
162
172
  ## Browser support
163
173