The ImageData
browser interface/API allows JavaScript to directly access pixel data in a <canvas> element. The data is represented as a one-dimensional array with RGBa values stored in separate indices.
Questions tagged [imagedata]
65 questions
10
votes
2 answers
How can I grayscale a canvas image in JavaScript?
I have an image inside of an HTML5 canvas with the size of 28x28 pixels. I get the imageData of the canvas as an array of RGBA (red, green, blue, alpha) values using this code:
canvas = document.getElementById('canvas');
ctx =…

Tom
- 151
- 1
- 1
- 8
4
votes
1 answer
javascript ImageData copy or move performance
I am writing a "waterfall" diagram for an SDR receiver which is displayed in a canvas on a web page.
The canvas has a size of w=1000 h=800 pixels.
The top line is delivered every 50ms from a server.
The browser (using javascript) must move all…

harry4516
- 193
- 8
3
votes
0 answers
Convert Uint8ClampedArray to Image file as shown below and tell me solution
I want to convert Uint8ClampedArray (as shown in image):-
to an image file(as shown in image):-
I want this conversion so that I can send that image file to an API in angular

V_for_Vj
- 849
- 1
- 12
- 30
2
votes
1 answer
TypeError: __array__() takes 1 positional argument but 2 were given?
I am working on transfer learning for an image classification task.
The training generator is as follows:
train_generator = train_datagen.flow_from_directory(
'/home/idu/Desktop/COV19D/train/',
color_mode = "grayscale",
…

Kenan Morani
- 141
- 1
- 9
2
votes
1 answer
To split the main data directory into Train/validation/test Set
I am working on X-ray image classification for which my data is stored in 1 directory and I need to divide it into train,validation and test set. I did manage to separate train and validation set using ImagedDataGenerator but am having troubles to…

tammy
- 43
- 5
2
votes
1 answer
What is the indexing logic in the ImageData array?
This question is for a deeper understanding of my previous question about large size Canvas animation. The question is here: Repeat HTML canvas element (box) to fill whole viewport
I am trying to understand the logic behind the TypedArray -…

DemiA
- 333
- 1
- 11
2
votes
1 answer
How to know ImageDataGenerator() assigns which label to which image class?
For binary classification of cats and dogs images, my directory structure is train_dir/cats and train_dir/dogs.
train_datagen = ImageDataGenerator(rescale=1/255)
train_generator = train_datagen.flow_from_directory(
…

Neo
- 4,200
- 5
- 21
- 27
2
votes
2 answers
Python Keras - Custom Labels in ImageDataGenerator
I am currently creating a CNN model that classifies whether the font is Arial, Verdana, Times New Roman and Georgia. All in all there are 16 classes since I considered also detecting whether the font is regular, bold, italics or bold italics. So 4…

alyssaeliyah
- 2,214
- 6
- 33
- 80
2
votes
0 answers
Avoiding two full copies to update a canvas from WebAssembly?
In JavaScript I can directly manipulate the pixels of a canvas and refresh them with a single copy:
ctx = canvas.getContext('2d')
imageData = ctx.getImageData(0, 0, canvas.width, canvas.height)
pixelTypedArray =…

hippietrail
- 15,848
- 18
- 99
- 158
2
votes
0 answers
Keras : Dealing with large image datasets
I am trying to fit a model using a large image datasets. I have a memory RAM of 14 GB, and the dataset have the size of 40 GB. I tried to use fit_generator, but I end up with a method that does not delete the loaded batchs after using theme.
If…

Khelifi Aymen
- 132
- 1
- 10
1
vote
1 answer
No evaluator found. Use `DefaultTrainer.test(evaluators=)`, or implement its `build_evaluator` method
I am using Detectron2 in a notebook and I keep getting the error: No evaluator found. Use DefaultTrainer.test(evaluators=), or implement its build_evaluator method.
I already have the build_evaluator function in the Trainer function.
class…

Azra Tuni
- 11
- 4
1
vote
1 answer
imageData on paletted png results in nearly duplicate colors
It's as it sounds.
The three brownish colors in the lower left corner above.
I expect up to 60 different colors from a paletted png with a palette that contains 60 colors on an image that claims only 16 colors, which I translated to the desired…

Nolo
- 846
- 9
- 19
1
vote
0 answers
How do I compress a large ImageData object into a manageable string that can be decompressed for later use?
I am currently trying to import an image onto a certain site, but the image's src is blocked by CSP as well as simply setting the image's src to the base64 data. I am trying to draw the image by importing the ImageData of the image as a compressed…

ski
- 11
- 2
1
vote
0 answers
AJAX receiving null data when a massive string is sent
I'm building a web application with laravel. I'm using jQuery to send ajax to another URL in my server. In ajax, i'm sending an image data which i created using html2canvas library. Here's the code i've written to do…

oliver davidson
- 49
- 7
1
vote
1 answer
Convert ImageData to ImageBytes in ActiveReports 16
I have the following code in ActiveReports 12 in the Designer.vb file. I'm manually upgrading to ActiveReports 16 (because choosing the upgrade option from the Visual Studio menu isn't working) and need to convert all instances of…

thecoolmacdude
- 2,036
- 1
- 23
- 38