@huh-david/bmp-js 0.3.0

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/dist/index.js ADDED
@@ -0,0 +1,539 @@
1
+ // src/decoder.ts
2
+ var BmpDecoder = class {
3
+ pos = 0;
4
+ buffer;
5
+ isWithAlpha;
6
+ bottomUp = true;
7
+ maskRed = 0;
8
+ maskGreen = 0;
9
+ maskBlue = 0;
10
+ mask0 = 0;
11
+ fileSize;
12
+ reserved;
13
+ offset;
14
+ headerSize;
15
+ width;
16
+ height;
17
+ planes;
18
+ bitPP;
19
+ compress;
20
+ rawSize;
21
+ hr;
22
+ vr;
23
+ colors;
24
+ importantColors;
25
+ palette;
26
+ data;
27
+ constructor(buffer, isWithAlpha = false) {
28
+ this.buffer = buffer;
29
+ this.isWithAlpha = isWithAlpha;
30
+ const flag = this.buffer.toString("utf-8", 0, this.pos += 2);
31
+ if (flag !== "BM") {
32
+ throw new Error("Invalid BMP File");
33
+ }
34
+ this.parseHeader();
35
+ this.parseRGBA();
36
+ }
37
+ parseHeader() {
38
+ this.fileSize = this.buffer.readUInt32LE(this.pos);
39
+ this.pos += 4;
40
+ this.reserved = this.buffer.readUInt32LE(this.pos);
41
+ this.pos += 4;
42
+ this.offset = this.buffer.readUInt32LE(this.pos);
43
+ this.pos += 4;
44
+ this.headerSize = this.buffer.readUInt32LE(this.pos);
45
+ this.pos += 4;
46
+ this.width = this.buffer.readUInt32LE(this.pos);
47
+ this.pos += 4;
48
+ this.height = this.buffer.readInt32LE(this.pos);
49
+ this.pos += 4;
50
+ this.planes = this.buffer.readUInt16LE(this.pos);
51
+ this.pos += 2;
52
+ this.bitPP = this.buffer.readUInt16LE(this.pos);
53
+ this.pos += 2;
54
+ this.compress = this.buffer.readUInt32LE(this.pos);
55
+ this.pos += 4;
56
+ this.rawSize = this.buffer.readUInt32LE(this.pos);
57
+ this.pos += 4;
58
+ this.hr = this.buffer.readUInt32LE(this.pos);
59
+ this.pos += 4;
60
+ this.vr = this.buffer.readUInt32LE(this.pos);
61
+ this.pos += 4;
62
+ this.colors = this.buffer.readUInt32LE(this.pos);
63
+ this.pos += 4;
64
+ this.importantColors = this.buffer.readUInt32LE(this.pos);
65
+ this.pos += 4;
66
+ if (this.bitPP === 16 && this.isWithAlpha) {
67
+ this.bitPP = 15;
68
+ }
69
+ if (this.bitPP < 15) {
70
+ const len = this.colors === 0 ? 1 << this.bitPP : this.colors;
71
+ this.palette = new Array(len);
72
+ for (let i = 0; i < len; i += 1) {
73
+ const blue = this.buffer.readUInt8(this.pos++);
74
+ const green = this.buffer.readUInt8(this.pos++);
75
+ const red = this.buffer.readUInt8(this.pos++);
76
+ const quad = this.buffer.readUInt8(this.pos++);
77
+ this.palette[i] = { red, green, blue, quad };
78
+ }
79
+ }
80
+ if (this.height < 0) {
81
+ this.height *= -1;
82
+ this.bottomUp = false;
83
+ }
84
+ }
85
+ parseRGBA() {
86
+ const len = this.width * this.height * 4;
87
+ this.data = Buffer.alloc(len);
88
+ switch (this.bitPP) {
89
+ case 1:
90
+ this.bit1();
91
+ return;
92
+ case 4:
93
+ this.bit4();
94
+ return;
95
+ case 8:
96
+ this.bit8();
97
+ return;
98
+ case 15:
99
+ this.bit15();
100
+ return;
101
+ case 16:
102
+ this.bit16();
103
+ return;
104
+ case 24:
105
+ this.bit24();
106
+ return;
107
+ case 32:
108
+ this.bit32();
109
+ return;
110
+ default:
111
+ throw new Error(`Unsupported BMP bit depth: ${this.bitPP}`);
112
+ }
113
+ }
114
+ getPaletteColor(index) {
115
+ const color = this.palette?.[index];
116
+ if (color) {
117
+ return color;
118
+ }
119
+ return {
120
+ red: 255,
121
+ green: 255,
122
+ blue: 255,
123
+ quad: 0
124
+ };
125
+ }
126
+ bit1() {
127
+ const xLen = Math.ceil(this.width / 8);
128
+ const mode = xLen % 4;
129
+ for (let y = this.height - 1; y >= 0; y -= 1) {
130
+ const line = this.bottomUp ? y : this.height - 1 - y;
131
+ for (let x = 0; x < xLen; x += 1) {
132
+ const b = this.buffer.readUInt8(this.pos++);
133
+ const location = line * this.width * 4 + x * 8 * 4;
134
+ for (let i = 0; i < 8; i += 1) {
135
+ if (x * 8 + i >= this.width) {
136
+ break;
137
+ }
138
+ const rgb = this.getPaletteColor(b >> 7 - i & 1);
139
+ this.data[location + i * 4] = 0;
140
+ this.data[location + i * 4 + 1] = rgb.blue;
141
+ this.data[location + i * 4 + 2] = rgb.green;
142
+ this.data[location + i * 4 + 3] = rgb.red;
143
+ }
144
+ }
145
+ if (mode !== 0) {
146
+ this.pos += 4 - mode;
147
+ }
148
+ }
149
+ }
150
+ bit4() {
151
+ if (this.compress === 2) {
152
+ let setPixelData2 = function(rgbIndex) {
153
+ const rgb = this.getPaletteColor(rgbIndex);
154
+ this.data[location] = 0;
155
+ this.data[location + 1] = rgb.blue;
156
+ this.data[location + 2] = rgb.green;
157
+ this.data[location + 3] = rgb.red;
158
+ location += 4;
159
+ };
160
+ var setPixelData = setPixelData2;
161
+ this.data.fill(255);
162
+ let location = 0;
163
+ let lines = this.bottomUp ? this.height - 1 : 0;
164
+ let lowNibble = false;
165
+ while (location < this.data.length) {
166
+ const a = this.buffer.readUInt8(this.pos++);
167
+ const b = this.buffer.readUInt8(this.pos++);
168
+ if (a === 0) {
169
+ if (b === 0) {
170
+ lines += this.bottomUp ? -1 : 1;
171
+ location = lines * this.width * 4;
172
+ lowNibble = false;
173
+ continue;
174
+ }
175
+ if (b === 1) {
176
+ break;
177
+ }
178
+ if (b === 2) {
179
+ const x = this.buffer.readUInt8(this.pos++);
180
+ const y = this.buffer.readUInt8(this.pos++);
181
+ lines += this.bottomUp ? -y : y;
182
+ location += y * this.width * 4 + x * 4;
183
+ continue;
184
+ }
185
+ let c = this.buffer.readUInt8(this.pos++);
186
+ for (let i = 0; i < b; i += 1) {
187
+ if (lowNibble) {
188
+ setPixelData2.call(this, c & 15);
189
+ } else {
190
+ setPixelData2.call(this, (c & 240) >> 4);
191
+ }
192
+ if ((i & 1) === 1 && i + 1 < b) {
193
+ c = this.buffer.readUInt8(this.pos++);
194
+ }
195
+ lowNibble = !lowNibble;
196
+ }
197
+ if ((b + 1 >> 1 & 1) === 1) {
198
+ this.pos += 1;
199
+ }
200
+ } else {
201
+ for (let i = 0; i < a; i += 1) {
202
+ if (lowNibble) {
203
+ setPixelData2.call(this, b & 15);
204
+ } else {
205
+ setPixelData2.call(this, (b & 240) >> 4);
206
+ }
207
+ lowNibble = !lowNibble;
208
+ }
209
+ }
210
+ }
211
+ return;
212
+ }
213
+ const xLen = Math.ceil(this.width / 2);
214
+ const mode = xLen % 4;
215
+ for (let y = this.height - 1; y >= 0; y -= 1) {
216
+ const line = this.bottomUp ? y : this.height - 1 - y;
217
+ for (let x = 0; x < xLen; x += 1) {
218
+ const b = this.buffer.readUInt8(this.pos++);
219
+ const location = line * this.width * 4 + x * 2 * 4;
220
+ const before = b >> 4;
221
+ const after = b & 15;
222
+ let rgb = this.getPaletteColor(before);
223
+ this.data[location] = 0;
224
+ this.data[location + 1] = rgb.blue;
225
+ this.data[location + 2] = rgb.green;
226
+ this.data[location + 3] = rgb.red;
227
+ if (x * 2 + 1 >= this.width) {
228
+ break;
229
+ }
230
+ rgb = this.getPaletteColor(after);
231
+ this.data[location + 4] = 0;
232
+ this.data[location + 5] = rgb.blue;
233
+ this.data[location + 6] = rgb.green;
234
+ this.data[location + 7] = rgb.red;
235
+ }
236
+ if (mode !== 0) {
237
+ this.pos += 4 - mode;
238
+ }
239
+ }
240
+ }
241
+ bit8() {
242
+ if (this.compress === 1) {
243
+ let setPixelData2 = function(rgbIndex) {
244
+ const rgb = this.getPaletteColor(rgbIndex);
245
+ this.data[location] = 0;
246
+ this.data[location + 1] = rgb.blue;
247
+ this.data[location + 2] = rgb.green;
248
+ this.data[location + 3] = rgb.red;
249
+ location += 4;
250
+ };
251
+ var setPixelData = setPixelData2;
252
+ this.data.fill(255);
253
+ let location = 0;
254
+ let lines = this.bottomUp ? this.height - 1 : 0;
255
+ while (location < this.data.length) {
256
+ const a = this.buffer.readUInt8(this.pos++);
257
+ const b = this.buffer.readUInt8(this.pos++);
258
+ if (a === 0) {
259
+ if (b === 0) {
260
+ lines += this.bottomUp ? -1 : 1;
261
+ location = lines * this.width * 4;
262
+ continue;
263
+ }
264
+ if (b === 1) {
265
+ break;
266
+ }
267
+ if (b === 2) {
268
+ const x = this.buffer.readUInt8(this.pos++);
269
+ const y = this.buffer.readUInt8(this.pos++);
270
+ lines += this.bottomUp ? -y : y;
271
+ location += y * this.width * 4 + x * 4;
272
+ continue;
273
+ }
274
+ for (let i = 0; i < b; i += 1) {
275
+ const c = this.buffer.readUInt8(this.pos++);
276
+ setPixelData2.call(this, c);
277
+ }
278
+ if ((b & 1) === 1) {
279
+ this.pos += 1;
280
+ }
281
+ } else {
282
+ for (let i = 0; i < a; i += 1) {
283
+ setPixelData2.call(this, b);
284
+ }
285
+ }
286
+ }
287
+ return;
288
+ }
289
+ const mode = this.width % 4;
290
+ for (let y = this.height - 1; y >= 0; y -= 1) {
291
+ const line = this.bottomUp ? y : this.height - 1 - y;
292
+ for (let x = 0; x < this.width; x += 1) {
293
+ const b = this.buffer.readUInt8(this.pos++);
294
+ const location = line * this.width * 4 + x * 4;
295
+ const rgb = this.getPaletteColor(b);
296
+ this.data[location] = 0;
297
+ this.data[location + 1] = rgb.blue;
298
+ this.data[location + 2] = rgb.green;
299
+ this.data[location + 3] = rgb.red;
300
+ }
301
+ if (mode !== 0) {
302
+ this.pos += 4 - mode;
303
+ }
304
+ }
305
+ }
306
+ bit15() {
307
+ const difW = this.width % 3;
308
+ const m = 31;
309
+ for (let y = this.height - 1; y >= 0; y -= 1) {
310
+ const line = this.bottomUp ? y : this.height - 1 - y;
311
+ for (let x = 0; x < this.width; x += 1) {
312
+ const value = this.buffer.readUInt16LE(this.pos);
313
+ this.pos += 2;
314
+ const blue = (value & m) / m * 255;
315
+ const green = (value >> 5 & m) / m * 255;
316
+ const red = (value >> 10 & m) / m * 255;
317
+ const alpha = value >> 15 !== 0 ? 255 : 0;
318
+ const location = line * this.width * 4 + x * 4;
319
+ this.data[location] = alpha;
320
+ this.data[location + 1] = blue | 0;
321
+ this.data[location + 2] = green | 0;
322
+ this.data[location + 3] = red | 0;
323
+ }
324
+ this.pos += difW;
325
+ }
326
+ }
327
+ bit16() {
328
+ const difW = this.width % 2 * 2;
329
+ this.maskRed = 31744;
330
+ this.maskGreen = 992;
331
+ this.maskBlue = 31;
332
+ this.mask0 = 0;
333
+ if (this.compress === 3) {
334
+ this.maskRed = this.buffer.readUInt32LE(this.pos);
335
+ this.pos += 4;
336
+ this.maskGreen = this.buffer.readUInt32LE(this.pos);
337
+ this.pos += 4;
338
+ this.maskBlue = this.buffer.readUInt32LE(this.pos);
339
+ this.pos += 4;
340
+ this.mask0 = this.buffer.readUInt32LE(this.pos);
341
+ this.pos += 4;
342
+ }
343
+ const ns = [0, 0, 0];
344
+ for (let i = 0; i < 16; i += 1) {
345
+ if ((this.maskRed >> i & 1) !== 0) ns[0] += 1;
346
+ if ((this.maskGreen >> i & 1) !== 0) ns[1] += 1;
347
+ if ((this.maskBlue >> i & 1) !== 0) ns[2] += 1;
348
+ }
349
+ ns[1] += ns[0];
350
+ ns[2] += ns[1];
351
+ ns[0] = 8 - ns[0];
352
+ ns[1] -= 8;
353
+ ns[2] -= 8;
354
+ for (let y = this.height - 1; y >= 0; y -= 1) {
355
+ const line = this.bottomUp ? y : this.height - 1 - y;
356
+ for (let x = 0; x < this.width; x += 1) {
357
+ const value = this.buffer.readUInt16LE(this.pos);
358
+ this.pos += 2;
359
+ const blue = (value & this.maskBlue) << ns[0];
360
+ const green = (value & this.maskGreen) >> ns[1];
361
+ const red = (value & this.maskRed) >> ns[2];
362
+ const location = line * this.width * 4 + x * 4;
363
+ this.data[location] = 0;
364
+ this.data[location + 1] = blue;
365
+ this.data[location + 2] = green;
366
+ this.data[location + 3] = red;
367
+ }
368
+ this.pos += difW;
369
+ }
370
+ }
371
+ bit24() {
372
+ for (let y = this.height - 1; y >= 0; y -= 1) {
373
+ const line = this.bottomUp ? y : this.height - 1 - y;
374
+ for (let x = 0; x < this.width; x += 1) {
375
+ const blue = this.buffer.readUInt8(this.pos++);
376
+ const green = this.buffer.readUInt8(this.pos++);
377
+ const red = this.buffer.readUInt8(this.pos++);
378
+ const location = line * this.width * 4 + x * 4;
379
+ this.data[location] = 0;
380
+ this.data[location + 1] = blue;
381
+ this.data[location + 2] = green;
382
+ this.data[location + 3] = red;
383
+ }
384
+ this.pos += this.width % 4;
385
+ }
386
+ }
387
+ bit32() {
388
+ if (this.compress === 3) {
389
+ this.maskRed = this.buffer.readUInt32LE(this.pos);
390
+ this.pos += 4;
391
+ this.maskGreen = this.buffer.readUInt32LE(this.pos);
392
+ this.pos += 4;
393
+ this.maskBlue = this.buffer.readUInt32LE(this.pos);
394
+ this.pos += 4;
395
+ this.mask0 = this.buffer.readUInt32LE(this.pos);
396
+ this.pos += 4;
397
+ for (let y = this.height - 1; y >= 0; y -= 1) {
398
+ const line = this.bottomUp ? y : this.height - 1 - y;
399
+ for (let x = 0; x < this.width; x += 1) {
400
+ const alpha = this.buffer.readUInt8(this.pos++);
401
+ const blue = this.buffer.readUInt8(this.pos++);
402
+ const green = this.buffer.readUInt8(this.pos++);
403
+ const red = this.buffer.readUInt8(this.pos++);
404
+ const location = line * this.width * 4 + x * 4;
405
+ this.data[location] = alpha;
406
+ this.data[location + 1] = blue;
407
+ this.data[location + 2] = green;
408
+ this.data[location + 3] = red;
409
+ }
410
+ }
411
+ return;
412
+ }
413
+ for (let y = this.height - 1; y >= 0; y -= 1) {
414
+ const line = this.bottomUp ? y : this.height - 1 - y;
415
+ for (let x = 0; x < this.width; x += 1) {
416
+ const blue = this.buffer.readUInt8(this.pos++);
417
+ const green = this.buffer.readUInt8(this.pos++);
418
+ const red = this.buffer.readUInt8(this.pos++);
419
+ const alpha = this.buffer.readUInt8(this.pos++);
420
+ const location = line * this.width * 4 + x * 4;
421
+ this.data[location] = alpha;
422
+ this.data[location + 1] = blue;
423
+ this.data[location + 2] = green;
424
+ this.data[location + 3] = red;
425
+ }
426
+ }
427
+ }
428
+ getData() {
429
+ return this.data;
430
+ }
431
+ };
432
+ function decode(bmpData) {
433
+ return new BmpDecoder(bmpData);
434
+ }
435
+
436
+ // src/encoder.ts
437
+ var BmpEncoder = class {
438
+ buffer;
439
+ width;
440
+ height;
441
+ extraBytes;
442
+ rgbSize;
443
+ headerInfoSize;
444
+ flag = "BM";
445
+ reserved = 0;
446
+ offset = 54;
447
+ fileSize;
448
+ planes = 1;
449
+ bitPP = 24;
450
+ compress = 0;
451
+ hr = 0;
452
+ vr = 0;
453
+ colors = 0;
454
+ importantColors = 0;
455
+ pos = 0;
456
+ constructor(imgData) {
457
+ this.buffer = imgData.data;
458
+ this.width = imgData.width;
459
+ this.height = imgData.height;
460
+ this.extraBytes = this.width % 4;
461
+ this.rgbSize = this.height * (3 * this.width + this.extraBytes);
462
+ this.headerInfoSize = 40;
463
+ this.fileSize = this.rgbSize + this.offset;
464
+ }
465
+ encode() {
466
+ const tempBuffer = Buffer.alloc(this.offset + this.rgbSize);
467
+ tempBuffer.write(this.flag, this.pos, 2);
468
+ this.pos += 2;
469
+ tempBuffer.writeUInt32LE(this.fileSize, this.pos);
470
+ this.pos += 4;
471
+ tempBuffer.writeUInt32LE(this.reserved, this.pos);
472
+ this.pos += 4;
473
+ tempBuffer.writeUInt32LE(this.offset, this.pos);
474
+ this.pos += 4;
475
+ tempBuffer.writeUInt32LE(this.headerInfoSize, this.pos);
476
+ this.pos += 4;
477
+ tempBuffer.writeUInt32LE(this.width, this.pos);
478
+ this.pos += 4;
479
+ tempBuffer.writeInt32LE(-this.height, this.pos);
480
+ this.pos += 4;
481
+ tempBuffer.writeUInt16LE(this.planes, this.pos);
482
+ this.pos += 2;
483
+ tempBuffer.writeUInt16LE(this.bitPP, this.pos);
484
+ this.pos += 2;
485
+ tempBuffer.writeUInt32LE(this.compress, this.pos);
486
+ this.pos += 4;
487
+ tempBuffer.writeUInt32LE(this.rgbSize, this.pos);
488
+ this.pos += 4;
489
+ tempBuffer.writeUInt32LE(this.hr, this.pos);
490
+ this.pos += 4;
491
+ tempBuffer.writeUInt32LE(this.vr, this.pos);
492
+ this.pos += 4;
493
+ tempBuffer.writeUInt32LE(this.colors, this.pos);
494
+ this.pos += 4;
495
+ tempBuffer.writeUInt32LE(this.importantColors, this.pos);
496
+ this.pos += 4;
497
+ let i = 0;
498
+ const rowBytes = 3 * this.width + this.extraBytes;
499
+ for (let y = 0; y < this.height; y += 1) {
500
+ for (let x = 0; x < this.width; x += 1) {
501
+ const p = this.pos + y * rowBytes + x * 3;
502
+ i += 1;
503
+ tempBuffer[p] = this.buffer.readUInt8(i++);
504
+ tempBuffer[p + 1] = this.buffer.readUInt8(i++);
505
+ tempBuffer[p + 2] = this.buffer.readUInt8(i++);
506
+ }
507
+ if (this.extraBytes > 0) {
508
+ const fillOffset = this.pos + y * rowBytes + this.width * 3;
509
+ tempBuffer.fill(0, fillOffset, fillOffset + this.extraBytes);
510
+ }
511
+ }
512
+ return tempBuffer;
513
+ }
514
+ };
515
+ function encode(imgData, quality = 100) {
516
+ void quality;
517
+ const encoder = new BmpEncoder(imgData);
518
+ const data = encoder.encode();
519
+ return {
520
+ data,
521
+ width: imgData.width,
522
+ height: imgData.height
523
+ };
524
+ }
525
+
526
+ // src/index.ts
527
+ var bmp = {
528
+ encode,
529
+ decode
530
+ };
531
+ var index_default = bmp;
532
+ export {
533
+ BmpDecoder,
534
+ BmpEncoder,
535
+ decode,
536
+ index_default as default,
537
+ encode
538
+ };
539
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/decoder.ts","../src/encoder.ts","../src/index.ts"],"sourcesContent":["import type { BmpPaletteColor, DecodedBmp } from \"./types\";\n\nclass BmpDecoder implements DecodedBmp {\n private pos = 0;\n private readonly buffer: Buffer;\n private readonly isWithAlpha: boolean;\n private bottomUp = true;\n\n private maskRed = 0;\n private maskGreen = 0;\n private maskBlue = 0;\n private mask0 = 0;\n\n fileSize!: number;\n reserved!: number;\n offset!: number;\n headerSize!: number;\n width!: number;\n height!: number;\n planes!: number;\n bitPP!: number;\n compress!: number;\n rawSize!: number;\n hr!: number;\n vr!: number;\n colors!: number;\n importantColors!: number;\n palette?: BmpPaletteColor[];\n data!: Buffer;\n\n constructor(buffer: Buffer, isWithAlpha = false) {\n this.buffer = buffer;\n this.isWithAlpha = isWithAlpha;\n\n const flag = this.buffer.toString(\"utf-8\", 0, (this.pos += 2));\n if (flag !== \"BM\") {\n throw new Error(\"Invalid BMP File\");\n }\n\n this.parseHeader();\n this.parseRGBA();\n }\n\n private parseHeader(): void {\n this.fileSize = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.reserved = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.offset = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.headerSize = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.width = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.height = this.buffer.readInt32LE(this.pos);\n this.pos += 4;\n this.planes = this.buffer.readUInt16LE(this.pos);\n this.pos += 2;\n this.bitPP = this.buffer.readUInt16LE(this.pos);\n this.pos += 2;\n this.compress = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.rawSize = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.hr = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.vr = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.colors = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.importantColors = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n\n if (this.bitPP === 16 && this.isWithAlpha) {\n this.bitPP = 15;\n }\n\n if (this.bitPP < 15) {\n const len = this.colors === 0 ? 1 << this.bitPP : this.colors;\n this.palette = new Array(len);\n for (let i = 0; i < len; i += 1) {\n const blue = this.buffer.readUInt8(this.pos++);\n const green = this.buffer.readUInt8(this.pos++);\n const red = this.buffer.readUInt8(this.pos++);\n const quad = this.buffer.readUInt8(this.pos++);\n this.palette[i] = { red, green, blue, quad };\n }\n }\n\n if (this.height < 0) {\n this.height *= -1;\n this.bottomUp = false;\n }\n }\n\n private parseRGBA(): void {\n const len = this.width * this.height * 4;\n this.data = Buffer.alloc(len);\n\n switch (this.bitPP) {\n case 1:\n this.bit1();\n return;\n case 4:\n this.bit4();\n return;\n case 8:\n this.bit8();\n return;\n case 15:\n this.bit15();\n return;\n case 16:\n this.bit16();\n return;\n case 24:\n this.bit24();\n return;\n case 32:\n this.bit32();\n return;\n default:\n throw new Error(`Unsupported BMP bit depth: ${this.bitPP}`);\n }\n }\n\n private getPaletteColor(index: number): BmpPaletteColor {\n const color = this.palette?.[index];\n if (color) {\n return color;\n }\n\n return {\n red: 0xff,\n green: 0xff,\n blue: 0xff,\n quad: 0x00,\n };\n }\n\n private bit1(): void {\n const xLen = Math.ceil(this.width / 8);\n const mode = xLen % 4;\n\n for (let y = this.height - 1; y >= 0; y -= 1) {\n const line = this.bottomUp ? y : this.height - 1 - y;\n for (let x = 0; x < xLen; x += 1) {\n const b = this.buffer.readUInt8(this.pos++);\n const location = line * this.width * 4 + x * 8 * 4;\n\n for (let i = 0; i < 8; i += 1) {\n if (x * 8 + i >= this.width) {\n break;\n }\n\n const rgb = this.getPaletteColor((b >> (7 - i)) & 0x1);\n this.data[location + i * 4] = 0;\n this.data[location + i * 4 + 1] = rgb.blue;\n this.data[location + i * 4 + 2] = rgb.green;\n this.data[location + i * 4 + 3] = rgb.red;\n }\n }\n\n if (mode !== 0) {\n this.pos += 4 - mode;\n }\n }\n }\n\n private bit4(): void {\n if (this.compress === 2) {\n this.data.fill(0xff);\n\n let location = 0;\n let lines = this.bottomUp ? this.height - 1 : 0;\n let lowNibble = false;\n\n while (location < this.data.length) {\n const a = this.buffer.readUInt8(this.pos++);\n const b = this.buffer.readUInt8(this.pos++);\n\n if (a === 0) {\n if (b === 0) {\n lines += this.bottomUp ? -1 : 1;\n location = lines * this.width * 4;\n lowNibble = false;\n continue;\n }\n\n if (b === 1) {\n break;\n }\n\n if (b === 2) {\n const x = this.buffer.readUInt8(this.pos++);\n const y = this.buffer.readUInt8(this.pos++);\n lines += this.bottomUp ? -y : y;\n location += y * this.width * 4 + x * 4;\n continue;\n }\n\n let c = this.buffer.readUInt8(this.pos++);\n for (let i = 0; i < b; i += 1) {\n if (lowNibble) {\n setPixelData.call(this, c & 0x0f);\n } else {\n setPixelData.call(this, (c & 0xf0) >> 4);\n }\n\n if ((i & 1) === 1 && i + 1 < b) {\n c = this.buffer.readUInt8(this.pos++);\n }\n\n lowNibble = !lowNibble;\n }\n\n if ((((b + 1) >> 1) & 1) === 1) {\n this.pos += 1;\n }\n } else {\n for (let i = 0; i < a; i += 1) {\n if (lowNibble) {\n setPixelData.call(this, b & 0x0f);\n } else {\n setPixelData.call(this, (b & 0xf0) >> 4);\n }\n lowNibble = !lowNibble;\n }\n }\n }\n\n function setPixelData(this: BmpDecoder, rgbIndex: number): void {\n const rgb = this.getPaletteColor(rgbIndex);\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n location += 4;\n }\n return;\n }\n\n const xLen = Math.ceil(this.width / 2);\n const mode = xLen % 4;\n\n for (let y = this.height - 1; y >= 0; y -= 1) {\n const line = this.bottomUp ? y : this.height - 1 - y;\n for (let x = 0; x < xLen; x += 1) {\n const b = this.buffer.readUInt8(this.pos++);\n const location = line * this.width * 4 + x * 2 * 4;\n\n const before = b >> 4;\n const after = b & 0x0f;\n\n let rgb = this.getPaletteColor(before);\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n\n if (x * 2 + 1 >= this.width) {\n break;\n }\n\n rgb = this.getPaletteColor(after);\n this.data[location + 4] = 0;\n this.data[location + 5] = rgb.blue;\n this.data[location + 6] = rgb.green;\n this.data[location + 7] = rgb.red;\n }\n\n if (mode !== 0) {\n this.pos += 4 - mode;\n }\n }\n }\n\n private bit8(): void {\n if (this.compress === 1) {\n this.data.fill(0xff);\n\n let location = 0;\n let lines = this.bottomUp ? this.height - 1 : 0;\n\n while (location < this.data.length) {\n const a = this.buffer.readUInt8(this.pos++);\n const b = this.buffer.readUInt8(this.pos++);\n\n if (a === 0) {\n if (b === 0) {\n lines += this.bottomUp ? -1 : 1;\n location = lines * this.width * 4;\n continue;\n }\n\n if (b === 1) {\n break;\n }\n\n if (b === 2) {\n const x = this.buffer.readUInt8(this.pos++);\n const y = this.buffer.readUInt8(this.pos++);\n lines += this.bottomUp ? -y : y;\n location += y * this.width * 4 + x * 4;\n continue;\n }\n\n for (let i = 0; i < b; i += 1) {\n const c = this.buffer.readUInt8(this.pos++);\n setPixelData.call(this, c);\n }\n\n if ((b & 1) === 1) {\n this.pos += 1;\n }\n } else {\n for (let i = 0; i < a; i += 1) {\n setPixelData.call(this, b);\n }\n }\n }\n\n function setPixelData(this: BmpDecoder, rgbIndex: number): void {\n const rgb = this.getPaletteColor(rgbIndex);\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n location += 4;\n }\n return;\n }\n\n const mode = this.width % 4;\n for (let y = this.height - 1; y >= 0; y -= 1) {\n const line = this.bottomUp ? y : this.height - 1 - y;\n for (let x = 0; x < this.width; x += 1) {\n const b = this.buffer.readUInt8(this.pos++);\n const location = line * this.width * 4 + x * 4;\n\n const rgb = this.getPaletteColor(b);\n this.data[location] = 0;\n this.data[location + 1] = rgb.blue;\n this.data[location + 2] = rgb.green;\n this.data[location + 3] = rgb.red;\n }\n\n if (mode !== 0) {\n this.pos += 4 - mode;\n }\n }\n }\n\n private bit15(): void {\n const difW = this.width % 3;\n const m = 0b11111;\n\n for (let y = this.height - 1; y >= 0; y -= 1) {\n const line = this.bottomUp ? y : this.height - 1 - y;\n for (let x = 0; x < this.width; x += 1) {\n const value = this.buffer.readUInt16LE(this.pos);\n this.pos += 2;\n\n const blue = ((value & m) / m) * 255;\n const green = (((value >> 5) & m) / m) * 255;\n const red = (((value >> 10) & m) / m) * 255;\n const alpha = value >> 15 !== 0 ? 0xff : 0x00;\n\n const location = line * this.width * 4 + x * 4;\n this.data[location] = alpha;\n this.data[location + 1] = blue | 0;\n this.data[location + 2] = green | 0;\n this.data[location + 3] = red | 0;\n }\n\n this.pos += difW;\n }\n }\n\n private bit16(): void {\n const difW = (this.width % 2) * 2;\n this.maskRed = 0x7c00;\n this.maskGreen = 0x03e0;\n this.maskBlue = 0x001f;\n this.mask0 = 0;\n\n if (this.compress === 3) {\n this.maskRed = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.maskGreen = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.maskBlue = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.mask0 = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n }\n\n const ns: [number, number, number] = [0, 0, 0];\n for (let i = 0; i < 16; i += 1) {\n if (((this.maskRed >> i) & 0x01) !== 0) ns[0] += 1;\n if (((this.maskGreen >> i) & 0x01) !== 0) ns[1] += 1;\n if (((this.maskBlue >> i) & 0x01) !== 0) ns[2] += 1;\n }\n\n ns[1] += ns[0];\n ns[2] += ns[1];\n ns[0] = 8 - ns[0];\n ns[1] -= 8;\n ns[2] -= 8;\n\n for (let y = this.height - 1; y >= 0; y -= 1) {\n const line = this.bottomUp ? y : this.height - 1 - y;\n for (let x = 0; x < this.width; x += 1) {\n const value = this.buffer.readUInt16LE(this.pos);\n this.pos += 2;\n\n const blue = (value & this.maskBlue) << ns[0];\n const green = (value & this.maskGreen) >> ns[1];\n const red = (value & this.maskRed) >> ns[2];\n\n const location = line * this.width * 4 + x * 4;\n this.data[location] = 0;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n\n this.pos += difW;\n }\n }\n\n private bit24(): void {\n for (let y = this.height - 1; y >= 0; y -= 1) {\n const line = this.bottomUp ? y : this.height - 1 - y;\n for (let x = 0; x < this.width; x += 1) {\n const blue = this.buffer.readUInt8(this.pos++);\n const green = this.buffer.readUInt8(this.pos++);\n const red = this.buffer.readUInt8(this.pos++);\n const location = line * this.width * 4 + x * 4;\n this.data[location] = 0;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n\n this.pos += this.width % 4;\n }\n }\n\n private bit32(): void {\n if (this.compress === 3) {\n this.maskRed = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.maskGreen = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.maskBlue = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n this.mask0 = this.buffer.readUInt32LE(this.pos);\n this.pos += 4;\n\n for (let y = this.height - 1; y >= 0; y -= 1) {\n const line = this.bottomUp ? y : this.height - 1 - y;\n for (let x = 0; x < this.width; x += 1) {\n const alpha = this.buffer.readUInt8(this.pos++);\n const blue = this.buffer.readUInt8(this.pos++);\n const green = this.buffer.readUInt8(this.pos++);\n const red = this.buffer.readUInt8(this.pos++);\n const location = line * this.width * 4 + x * 4;\n this.data[location] = alpha;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n }\n\n return;\n }\n\n for (let y = this.height - 1; y >= 0; y -= 1) {\n const line = this.bottomUp ? y : this.height - 1 - y;\n for (let x = 0; x < this.width; x += 1) {\n const blue = this.buffer.readUInt8(this.pos++);\n const green = this.buffer.readUInt8(this.pos++);\n const red = this.buffer.readUInt8(this.pos++);\n const alpha = this.buffer.readUInt8(this.pos++);\n const location = line * this.width * 4 + x * 4;\n this.data[location] = alpha;\n this.data[location + 1] = blue;\n this.data[location + 2] = green;\n this.data[location + 3] = red;\n }\n }\n }\n\n getData(): Buffer {\n return this.data;\n }\n}\n\nexport function decode(bmpData: Buffer): DecodedBmp {\n return new BmpDecoder(bmpData);\n}\n\nexport { BmpDecoder };\n","import type { BmpImageData, EncodedBmp } from \"./types\";\n\nclass BmpEncoder {\n private readonly buffer: Buffer;\n private readonly width: number;\n private readonly height: number;\n private readonly extraBytes: number;\n private readonly rgbSize: number;\n private readonly headerInfoSize: number;\n\n private readonly flag = \"BM\";\n private readonly reserved = 0;\n private readonly offset = 54;\n private readonly fileSize: number;\n private readonly planes = 1;\n private readonly bitPP = 24;\n private readonly compress = 0;\n private readonly hr = 0;\n private readonly vr = 0;\n private readonly colors = 0;\n private readonly importantColors = 0;\n\n private pos = 0;\n\n constructor(imgData: BmpImageData) {\n this.buffer = imgData.data;\n this.width = imgData.width;\n this.height = imgData.height;\n this.extraBytes = this.width % 4;\n this.rgbSize = this.height * (3 * this.width + this.extraBytes);\n this.headerInfoSize = 40;\n this.fileSize = this.rgbSize + this.offset;\n }\n\n encode(): Buffer {\n const tempBuffer = Buffer.alloc(this.offset + this.rgbSize);\n\n tempBuffer.write(this.flag, this.pos, 2);\n this.pos += 2;\n tempBuffer.writeUInt32LE(this.fileSize, this.pos);\n this.pos += 4;\n tempBuffer.writeUInt32LE(this.reserved, this.pos);\n this.pos += 4;\n tempBuffer.writeUInt32LE(this.offset, this.pos);\n this.pos += 4;\n\n tempBuffer.writeUInt32LE(this.headerInfoSize, this.pos);\n this.pos += 4;\n tempBuffer.writeUInt32LE(this.width, this.pos);\n this.pos += 4;\n tempBuffer.writeInt32LE(-this.height, this.pos);\n this.pos += 4;\n tempBuffer.writeUInt16LE(this.planes, this.pos);\n this.pos += 2;\n tempBuffer.writeUInt16LE(this.bitPP, this.pos);\n this.pos += 2;\n tempBuffer.writeUInt32LE(this.compress, this.pos);\n this.pos += 4;\n tempBuffer.writeUInt32LE(this.rgbSize, this.pos);\n this.pos += 4;\n tempBuffer.writeUInt32LE(this.hr, this.pos);\n this.pos += 4;\n tempBuffer.writeUInt32LE(this.vr, this.pos);\n this.pos += 4;\n tempBuffer.writeUInt32LE(this.colors, this.pos);\n this.pos += 4;\n tempBuffer.writeUInt32LE(this.importantColors, this.pos);\n this.pos += 4;\n\n let i = 0;\n const rowBytes = 3 * this.width + this.extraBytes;\n\n for (let y = 0; y < this.height; y += 1) {\n for (let x = 0; x < this.width; x += 1) {\n const p = this.pos + y * rowBytes + x * 3;\n i += 1; // skip alpha from ABGR\n tempBuffer[p] = this.buffer.readUInt8(i++); // blue\n tempBuffer[p + 1] = this.buffer.readUInt8(i++); // green\n tempBuffer[p + 2] = this.buffer.readUInt8(i++); // red\n }\n\n if (this.extraBytes > 0) {\n const fillOffset = this.pos + y * rowBytes + this.width * 3;\n tempBuffer.fill(0, fillOffset, fillOffset + this.extraBytes);\n }\n }\n\n return tempBuffer;\n }\n}\n\nexport function encode(imgData: BmpImageData, quality = 100): EncodedBmp {\n void quality;\n const encoder = new BmpEncoder(imgData);\n const data = encoder.encode();\n\n return {\n data,\n width: imgData.width,\n height: imgData.height,\n };\n}\n\nexport { BmpEncoder };\n","import { decode } from \"./decoder\";\nimport { encode } from \"./encoder\";\n\nexport type { BmpImageData, BmpPaletteColor, DecodedBmp, EncodedBmp } from \"./types\";\nexport { BmpDecoder } from \"./decoder\";\nexport { BmpEncoder } from \"./encoder\";\nexport { encode, decode };\n\nconst bmp = {\n encode,\n decode,\n};\n\nexport default bmp;\n"],"mappings":";AAEA,IAAM,aAAN,MAAuC;AAAA,EAC7B,MAAM;AAAA,EACG;AAAA,EACA;AAAA,EACT,WAAW;AAAA,EAEX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,QAAQ;AAAA,EAEhB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAY,QAAgB,cAAc,OAAO;AAC/C,SAAK,SAAS;AACd,SAAK,cAAc;AAEnB,UAAM,OAAO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PixelData"]}
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@huh-david/bmp-js",
3
+ "version": "0.3.0",
4
+ "description": "A pure TypeScript BMP encoder and decoder for Node.js",
5
+ "keywords": [
6
+ "bmp",
7
+ "cjs",
8
+ "decoder",
9
+ "encoder",
10
+ "esm",
11
+ "image",
12
+ "typescript"
13
+ ],
14
+ "homepage": "https://github.com/Huh-David/bmp-js#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/Huh-David/bmp-js/issues"
17
+ },
18
+ "license": "MIT",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/Huh-David/bmp-js.git"
22
+ },
23
+ "funding": {
24
+ "type": "github",
25
+ "url": "https://github.com/sponsors/Huh-David"
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "LICENSE",
30
+ "README.md"
31
+ ],
32
+ "type": "module",
33
+ "sideEffects": false,
34
+ "main": "./dist/index.cjs",
35
+ "module": "./dist/index.js",
36
+ "types": "./dist/index.d.ts",
37
+ "exports": {
38
+ ".": {
39
+ "types": "./dist/index.d.ts",
40
+ "import": "./dist/index.js",
41
+ "require": "./dist/index.cjs",
42
+ "default": "./dist/index.js"
43
+ },
44
+ "./package.json": "./package.json"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public",
48
+ "provenance": true
49
+ },
50
+ "scripts": {
51
+ "clean": "rimraf dist coverage",
52
+ "build": "tsup --config tsup.config.ts",
53
+ "test": "pnpm build && vitest run",
54
+ "test:watch": "vitest",
55
+ "lint": "oxlint --import-plugin --vitest-plugin src test",
56
+ "format": "oxfmt --write .",
57
+ "format:check": "oxfmt --check .",
58
+ "typecheck": "tsc --project tsconfig.json --noEmit && tsc --project tsconfig.test.json --noEmit",
59
+ "check": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm test",
60
+ "changeset": "changeset",
61
+ "version-packages": "changeset version",
62
+ "release": "changeset publish",
63
+ "prepack": "pnpm clean && pnpm build"
64
+ },
65
+ "devDependencies": {
66
+ "@changesets/cli": "^2.30.0",
67
+ "@types/node": "^24.6.0",
68
+ "oxfmt": "^0.42.0",
69
+ "oxlint": "^1.57.0",
70
+ "rimraf": "^6.0.1",
71
+ "tsup": "^8.5.1",
72
+ "typescript": "^5.9.3",
73
+ "vitest": "^3.2.4"
74
+ },
75
+ "engines": {
76
+ "node": ">=22"
77
+ },
78
+ "packageManager": "pnpm@10.22.0"
79
+ }