The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [image]

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

Filter by
Sorted by
Tagged with
9
votes
2answers
3k views

Pure JS Image Slider

I was just wanting a code review on this image slider I made. I don't have anyone else to give me their opinion on the code I write outside of work. Is this sloppy? Is it wrong? Is it ineffective? ...
9
votes
1answer
93 views

Writing data into an image

I've done a script that will write things as images, which can then be read elsewhere (eg. you could share an mp3 through imgur). This is the first one I've done where I've been trying to improve my ...
9
votes
1answer
232 views

Maze generator in Python- Gif animator-Custom colors/sizes

This Python code generates mazes with color and size customization. I intend to add several new maze generating algorithms(Sidewinder, Kruskal, Prim ...) to the Maze class but for now, there is only ...
9
votes
2answers
763 views

Decoding grayscale PNG and performing Prewitt operator for edge detection

I'm a hobbyist programmer. What I try to do here is to read 8-bit grayscale PNG file. Then unfilter it. (That caused a headache). And after that perform Prewitt operator for "edge detection". I know ...
9
votes
2answers
2k views

Mandelbrot Set Fractal

I thought I would give this months community challenge a try. This is my first time using Python. It does take quite a while to run and it's not very colourful but it works. ...
9
votes
1answer
12k views

Fastest way to count non-zero pixels using Python and Pillow

I have a Python script that creates a diff of two images using PIL. That part works fine. Now I need to find an efficient way to count all the non-black pixels (which represent parts of the two images ...
9
votes
1answer
126 views

Maze image solver and animator in Python

This maze solver is a continuation to the maze generator I posted here recently Maze generator & animator in Python This code takes an image containing a 2-color maze as input and solves the maze ...
9
votes
1answer
2k views

Efficient extraction of patch features over an image

Input: data - a matrix of size n*m*3*3 (complex values) indices - a list of coordinates (x,y), where x < n and y < m fp - a feature parameter which is a tuple of ((fp11, fp12), (fp21, fp22)), ...
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 ...
8
votes
2answers
1k views

Convert a 24bit bitmap to grayscale

I wrote this so I can learn CUDA. This is coded to work on my laptop's Nvidia GeForce GT 540M. Main points I need reviewed: CUDA programming conventions Performance, especially kernel speed C ...
8
votes
1answer
2k views

Organizing and visually duplicating images

This algorithm is supposed to organize and visually duplicate images. I compare 2 images at a time; 1 is the first index image of the directory and another for comparing every other image in the ...
8
votes
1answer
155 views

Bilinear image interpolation

I have written a bilinear interpolant, which is working moderately well except that is painfuly slow. How can rewrite the code to make it faster? Using opencv directly isn't a valid answer. ...
8
votes
1answer
294 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. ...
8
votes
2answers
2k views

Color substitution in a BufferedImage

The setPixelColor function below changes the color of pixels. I need some suggestions to optimize this function. Example: ...
8
votes
1answer
214 views

Convert an image into characters and colors for the windows console

I've written a function to convert an image into characters and colors for the windows console. At the moment the calculation takes about 13 seconds with a 700x700 pixel image but that time is ...
8
votes
2answers
237 views

Graphical editor programming challenge

I have posted here my working and accepted solution to the graphical editor programming challenge (detailed here) for your review. The program recognizes the following image editing commands: ...
8
votes
1answer
146 views

Matlab Computer Vision

The code below takes a video as input (a drop onto a fabric surface) and I want it to return the area of the drop. Currently the code works, but I'm no Matlab expert, and wrote it entirely through ...
8
votes
1answer
941 views

Rotating and printing an image

I carefully used smart pointer to avoid memory leaks and dangling pointers, but someone says my code has memory leaks. Is it true? If so, how can I fix it? ...
8
votes
2answers
1k views

Adding a Fish Eye Distortion to a Bitmap

I have the following class that processes a Bitmap to place a fisheye distortion on it. I've run my app through TraceView and found that virtually all the processing time is spent looping through the ...
8
votes
1answer
248 views

Kernel Convolution in Python 2.7

The code I wrote performs a mean blur on an image (I hardcoded it as zebra.jpg for testing purposes). My problem is that for an image of 39KB image it take minutes to perform, is there any way of ...
8
votes
1answer
98 views

Image labeling: it's Monday again

This command line program applies defined labels along with Monday's date to a directory of images. The script has to handle not being run on a Monday. Others are asking for the script so I cleaned ...
8
votes
1answer
336 views

Image manipulation using HTML5 Canvas

I have recently started researching some computer vision, and in the process of discovering some interesting things I have been compiling some functions that allow me to manipulate images at a low ...
8
votes
2answers
418 views

Camera intents and file manipulation

I am building an Android application and there are five Activity classes or if you're familiar with the MVC pattern they would usually be the ...
8
votes
1answer
2k views

Handling large images efficiently (to avoid OutOfMemoryError)

After lots of attempts thanks to all the Android enthusiasts, I've found a method to handle large images efficiently in Android Applications in order to get rid of ...
8
votes
1answer
448 views

Adding filters to images

Here is some code I wrote as part of a project that I am working on to learn C#. It is a class responsible for applying filters to images. In this case, my code offers filters such as sepia and ...
8
votes
1answer
178 views

Barcode (Code 128)

I wrote the code below to generate Code 128 barcodes, based on the specs. ...
8
votes
2answers
481 views

Taking flight with JavaFX

Just another step in my educational Trek. I didn't know when/why I would use the transparent feature and in experimenting with it, I made this. This one was fun to behold once done. It's an animated ...
7
votes
4answers
837 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 ...
7
votes
5answers
758 views

Writing image pixel data to printer code

I've been trying to take image pixel data and write it out into printer code and my results are rather slow. Here is a simplified version of what I have so far (image is a PIL Image object of 1200 x ...
7
votes
2answers
272 views

Speed optimization for transparent gradient blend algorithm

The following algorithm works correctly for the purposes that I need, which is to set the top side of an image with a transparent gradient blend. Any tips to optimize it for speed? ...
7
votes
1answer
3k views

Finding rectangles in an image

So my this class is one in which is used to find rectangles in images that have already been pre-processed. For example the images are to be deskewed, greyscale etc. Following feedback off of various ...
7
votes
1answer
382 views

Turning music into an image

I was bored, so I wrote something that could turn .wav files in to .bmps: ...
7
votes
3answers
6k views

Fastest way to change the HSV value of all pixels in a bitmap

I want to change all the pixels in an image to have the same value, in terms of the HSV colour space. At the moment I'm running the following code: ...
7
votes
2answers
707 views

Is there a way to optimise my Perlin noise?

I just started using Perlin noise a few days ago, and the results look quite good. But it takes over 3 seconds to calculate and draw a 1024x1024 bitmap of said noise. I use an array of 1024x1024 to ...
7
votes
3answers
480 views

Go through every pixel of an image and then dispose of it

I'm a little confused as to whether implementing the Dispose method serves a purpose in this code. It never gets referenced by any other class in my project, so ...
7
votes
2answers
29k views

Check image dimensions, calculate aspect ratio, set image dimensions, resize

I have created a set of functions to calculate the aspect ratio of an image, set a height/width on document.ready and on ...
7
votes
2answers
1k views

PHP library for handling account creations, logins, and file uploads

I'm new to OOP and PHP. I've made an attempt at a PHP library file that handles account creations, logins, and file uploads with image resizing on the fly. It works so far. I'd like some help with ...
7
votes
2answers
3k views

Applying a 'mean filter'

I am just trying to apply a "mean filter" with C#. The working code below gets window size (3,5,7,9,...) from textBoxWinSize and applies the mean filter. I am new ...
7
votes
1answer
52 views

Loading BitmapImages out of a Zip file

I'm working on a personal project to get better with C#, and as part of that I have a zip file with 20 or so images saved inside. I want to load those images out of the zip file and display them in my ...
7
votes
1answer
2k views

Finding and pasting images into a specific cell

The below macro finds and pastes images into column A. While the macro works, it starts to slow down when running 500+ images. I am not too familiar with the VBA language, does anyone have any ...
7
votes
3answers
306 views

Breadth-first search for clusters of pixels in a given color range

I am a beginner in programming languages, so I apologise if my code is badly formatted or doesn't make any sense. My program gets an image and a RGB color range as input and it counts how many pixels ...
7
votes
1answer
13k views

Thumbnails for bootstrap carousel jQuery plugin

Codepen: http://codepen.io/srkimir/pen/mGbrf Github: https://github.com/srkimir/thumbnails-carousel While you slide left or right appropriately, thumbnails gets selected and change their opacity to ...
7
votes
2answers
387 views

Diagonal gradient optimization

With the SDL library, I'm creating an SDL_Surface* at w and h dimensions. ...
7
votes
2answers
273 views

png2jpeg, a utility for converting PNG to JPEG (rev. 1/3)

Revisions: Revision 1 (you are here) Revision 2 Revision 3 I've been working on a simple command-line png2jpeg utility. Its purpose is to convert images from PNG format to JPEG. The source code ...
7
votes
1answer
133 views

Editing Surfaces Removing Color

So I have recently tried to load an image and save it, but remove all of a certain color. I'm running the program and it is running really slow, is there a more efficient way to edit an image? My code ...
7
votes
1answer
517 views

Reddit RepostFinder Bot

I've been making a bot for Reddit that finds reposts (based on image MD5 comparing) and posts a small comment on the thread (that part will be later, right now it downloads images and compares MD5). ...
7
votes
2answers
128 views

Comparing image resolutions to ratios

I made this Python 3.6 program that generates a list of images that fail to compare against a given ratio. Each image has a resolution and with a bit of math, the program is supposed to calculate the ...
7
votes
2answers
350 views

Terrain height map generator

I wrote a Perl script that implements the algorithm described in this article to generate terrain height maps. The idea is to raise a random hill \$i\$ of size \$r_i\$ centered at point \$(x_i, y_i)\$...
7
votes
1answer
41 views

Bash script to encode images in base64 and generate a CSS file from them

These are the first lines of code I've ever written. I've been interested in the idea of learning to program for quite a while, but never really pulled the trigger, and now I've been playing around ...
7
votes
1answer
2k views

Update bitmap in picturebox with data from a socket

I'm working on a screen sharing project, and I receive a small block of images from a Socket constantly. I need to update them on a certain initial desktop bitmap I ...