Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [image]

This tag is for questions related to the loading, formatting, saving, compression, and display of data representing pictures.

1
vote
0answers
18 views

Android app to take a photos and show them in a gallery

Gallery will be displayed in RecyclerView. User can select some images and delete it with one button. It all works, but i think I have bad code, because I don't use some instruments (like fragment). ...
2
votes
2answers
21 views

Split all images over x amount of pages with $_GET

I would like to receive some feedback on the code I am currently using to display x amount of images on my website per ...
7
votes
0answers
56 views

Replace color in image measured by Euclidean distance

This script replaces the red hair in image to black color (replace one color to another) Three major parts in this script Not just replace color red to black, I hope the output image looks natural, ...
3
votes
1answer
240 views
+100

Uploading and showing images securely

I've read various posts about how letting users to upload files can create vulnerabilities to your website such as a user injecting PHP code in an image. So I've created a small test project where ...
3
votes
0answers
34 views

Image Manipulation with PIL/Pillow - Picture effect/filter

I was curious about image manipulation and I was wondering how it was working, so I made some little functions wich are modifying the pictures passed in parameter. The graphics results are not too bad,...
3
votes
1answer
47 views

YUV422 to RGB24 using Intel Performance Primitives

I have a C++ method that uses the Intel performance primitives library to convert an image from YUV422 format into RGB 24. I am PInvoking this method from C# (WPF) where the YUV images are coming from ...
4
votes
0answers
34 views

Functional blob counting

I have image files consisting of black and white pixels encoded as RGB8. I want to count the number of blobs i.e. contiguous areas of white pixels. I rewrote this algorithm in haskell. The algorithm ...
4
votes
1answer
35 views

Shell function to convert .png to .svg file

I needed to convert some custom icons that were in .png format to .svg format and did not want to use an online converter for it. I could not find an out-of-the-box solution online so I created my ...
1
vote
0answers
23 views

Gray-level co-occurrence matrix feature computation

I have many images and want to compute the GLCM properties for every image. Below my code that runs many hours to complete the task: ...
1
vote
1answer
32 views

Laravel image upload

I'm new to the filesystem from Laravel, but I need an upload script that allows users to upload images to my server. However, i'm concerned about securety, so I thought why not ask for advice, because ...
7
votes
4answers
633 views

Caching Color-Bitmaps as MemoryStreams

I am in the need to cache Bitmap's in a memory-optimized way because the API I am building will need to process many colored ...
11
votes
4answers
3k views

Python 3 function to rotate an image 90°

A coding challenge that rotates an image 90 degrees counterclockwise. The image is represented as an array matrix. I believe the time complexity is O(n2), but I'd like to know for sure, as well as any ...
3
votes
1answer
68 views

Centered finite difference approximation for edge enhancement

I implemented a centered finite difference approximation for edge enhancement in images. The difference approximation has a step size h of the partial derivatives in the x- and y-directions of a 2D-...
2
votes
2answers
116 views

Finding a word that represents an image

This is an app wherein you have to find the word that represents the image. It's the same concept as the course app but I did this one myself. How can I improve this code (put more commentary, put ...
2
votes
1answer
343 views

Send blob image using Ajax/PHP

I have an image cropper that crops the uploaded image, Before sending it to the server using PHP and AJAX. Here is a live fiddle to preview a working cropping example. Here is the code: ...
3
votes
1answer
281 views

jQuery image carousel

I have made this custom image carousel, using HTML5, jQuery and CSS. My aim was to make it really lightweight but with (just) enough features: "bullets", auto-advance, responsiveness. ...
3
votes
1answer
92 views

Flood Fill using unordered_map which has user-defined type as key

I have an implementation of the flood fill algorithm. Assume that an image is provided as a vector of ...
2
votes
3answers
70 views

Converting colours in an image using Python Imaging Library

I have written the beginning of a map engine which runs off PIL and some JavaScript client side. Ignoring the rest of the code that is in the same file as this function, can you suggest any ...
2
votes
1answer
106 views

Image processing using Python OOP library

I am trying to learn OOP by refactoring my existing code (functions only). This example works but I am not sure whether it is pythonic and good practice. I have a shared library which consist of ...
3
votes
1answer
38 views

Tone Mapping image manipulation

This code is extremely slow and ideally I would appreciate someone walking me through getting this going on the GPU, but if nobody has time for that which is understandable, any and all optimisations ...
4
votes
0answers
41 views

Drawing the Mandelbrot with multiple threads in rust

The code below draws the mandelbrot set for { z | z∈ ℂ, -2.2 ≤ Re(z) ≤ 0.6, -1.4 ≤ Im(z) ≤ 1.4} into a 300×300px png image. For each pixel, if the sequence {zi} is found to ...
6
votes
1answer
113 views

Moore-Neighbor Tracing Algorithm

I wrote code to extract the contour of a hole, based mostly on the Moore-Neighbor Tracing algorithm. Only a. instead of finding a shape, I'm finding a "hole"; and, b. I'm looking for the (outer) ...
2
votes
0answers
399 views

PyQt5 - Open new image window for each button click in menu

I wanted to write a code that each time I will press some button in my menu, a numpy image array will somehow be created, and this image will show up in a new window. So the following code is the ...
6
votes
0answers
115 views

Python class for organizing images for machine learning

I built a class to help me handle image data to use in machine learning. I thought that there would be a pre-existing package that did what I wanted but I couldn't find it so I wrote this. I am not ...
4
votes
1answer
67 views

A helper class for creating icons from a PNG image and colour in Swift

I have made a helper struct in Swift that creates circular icons from a PNG image (a white icon on transparent background) and a background ...
2
votes
1answer
69 views

PHP Template: Image file upload handler

I'm trying to develop some templates for common PHP tasks I've been dealing with. One of which is a general image file upload handler. So far I'm using the following reusable code which seems to be ...
10
votes
1answer
84 views

Slow image generation

I build a Tower of Hanoi solver which print the solution as an image It works as expected but generating the image is relatively slow compared to the time to calculate the answer. Here is the code: ...
1
vote
1answer
46 views

Сlone image in pure js

I wrote JS to clone image and attached this action to button. It works but I'm not sure that this better way to do it. My questions: is it correct to use querySelector to return elements, or is it ...
0
votes
0answers
39 views

Render a variable image of a flag in React Native

I'm learning React-Native, and looking for some feedback. I have an image of a flag, that is associated with a language. There over 150 languages. Here is what is working: ...
4
votes
2answers
122 views

Detecting a certain amount of violet in an image - follow-up

I'm trying to write a program to detect the colour violet in an image.As discussed in my previous Post @Johnbot suggested that I try using HSL / HSV to determine if the pixel is some shade of violet. ...
7
votes
1answer
2k views

Read and write BMP file in C

I'm teaching myself a little C, and I've found this website. It has an exercise about manipulating a BMP file in C. I would like to know if I can make my code look more "idiomatic" or professional, ...
10
votes
1answer
236 views

Image template matching algorithm from scratch

I wanted to write a template matching algorithm from scratch. The key area's I'm interesting in are readability, maintainability, DRY, and if the program performance/efficiency could be improved in ...
4
votes
1answer
54 views

Class made to do some basic RGB analysis

I created this class to load in an image and get some specific values I needed. ...
8
votes
3answers
1k views

Detecting a certain amount of violet in an image

I need to be able to detect if an image has the colour Violet in it. (Follow-up) The problem that I'm facing is that there are quite a number of shades of violet that it seems almost impossible it ...
5
votes
2answers
109 views

Read an image with ADNS2610 optical sensor and Arduino Uno

Preliminaries I have optical sensor ADNS2610 (see datasheet here). There are a few problems which it can be used to solve, but for now let us focus on getting an image from that sensor. This sensor ...
4
votes
1answer
100 views

Parallelized Sobel algorithm using OpenMP

I implemented the Sobel algorithm sequentially, and got decent performance (1.49 s) but wanted to improve it. I parallelized it with OpenMP and got a ~3x speedup (0.523 s). I'd like to do better, but ...
8
votes
1answer
120 views

Python function to implement an image-processing pipeline

I have written the following function to process images. Now I am not sure if it's pythonic or considered as spaghetti code. I know being flat is better than nested, but I don't see a way around it. ...
3
votes
0answers
53 views

Searching for the location of a sub-image within an image

I have a number of images that were cropped and their backgrounds removed. I've tried to write a function that will search the original unmodified image for the cropped image so that I can restore the ...
0
votes
0answers
114 views

RGB to HSV image conversion with CUDA, with branching and branchless versions

I have created two CUDA kernels for converting a 3 channel 16-bit RGB image to a 3 channel 16-bit HSV image. The first kernel below performs the usual algorithm in a fairly straight forward manner as ...
10
votes
2answers
2k views

Writing a bitmap image from C++

Here's my function that creates a bitmap file from an array of pixels. It can write a bitmap both with transparency and without transparency. Please review my code and give constructive criticism on ...
2
votes
0answers
45 views

Iterate through images really fast with JS

My objective is to modify the JavaScript code to get the single image on the page to iterate through images faster. It should be possible to get the images to load in about 10 seconds(about 3 seconds ...
2
votes
3answers
590 views

Display Thousands/Millions of different background images

Kindly help me check this code, I want to be able to make it load thousands/millions of different pictures as HTML background without crashing or slowing down the browser. The images can be created ...
5
votes
2answers
86 views

Threshold an image for a given range and Sobel kernel

The class defines functions to threshold an image for a given range and Sobel kernel. Each function has similarities, i.e. they share the same following tasks: each function converts an image to ...
4
votes
2answers
1k views

Median Filter Implementation In Python

I implemented median filter in Python in order to remove the salt & pepper noise from the images. It is working fine and all but I would love to hear your advice or opinions. ...
6
votes
1answer
380 views

Automatic image cropping in Python 3

I made a script to automate the cropping of spectrogram images I generated using Matlab. I have 4 different types of images (Fixed height, but varying width) and they are cropped differently ...
3
votes
1answer
47 views

Checking whether an image is part of another

I have the following code (slightly modified for simplicity). It checks whether a given image A (the template) is part of another image B. To handle different sizes, image B is scaled as long as a ...
11
votes
2answers
1k views

K-Means image segmentation algorithm

I am a new C++ programmer and I have some experience in Python and C but I was almost completely self taught (I learned C++ with OpenClassrooms). I would like to learn the conventions and how things ...
5
votes
1answer
83 views

Classes to encode and decode images

I'm a developing a image processor, which reads a Base64 (compressed) image and writes its subimage to targets on threads. (Constructors, exception handling, and ...
2
votes
0answers
36 views

Image slider code

I've been doing this image slider section, I've been working on this code for quite a time, the code is perfectly working but I want to improve it. I tried for hours and couldn't find a way. Maybe ...
3
votes
1answer
361 views

Resize and compress images with imagick

I am building a PHP function to manipulate and generate a series of images with Imagick. The aim is to make responsive images with the <picture> element. ...