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
1
vote
1answer
195 views

Load bitmap object data into array of byte values

I'm building this as part of a larger class to rapidly search for smaller images inside larger images. This is my first serious F# project so comments especially concerning style and organization are ...
1
vote
1answer
611 views

Image upload and thumbnail creation script using PHP GD

Ignoring my shocking use of the mysql_* extension (and any associated issues), could you take a look at my script that uploads an image, adds it to a database, ...
1
vote
1answer
5k views

BMP file reader

I've started with developing BMP format reader in C#. This tool might read all data from binary BMP file and represents all data from it (from the header, the pixel data etc). I have started and have ...
4
votes
1answer
214 views

Does my image upload look safe enough?

I have an image upload script that uploads images to the server: ...
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 ...
4
votes
2answers
20k views

Resize image with good quality and less weight

I want to resize an image with good quality, and the most important thing is having less weight for an image so that webpages will load it faster. I am using the below method for this. Please check ...
6
votes
1answer
242 views

Rotating background using Swing: performance issues

In a jPanel, I'm displaying a 1203x1203 background that I rotate every 30ms. Problem is, Swing is known to be a slow library, and I assume rotating a huge picture at a quick rate would be quite ...
2
votes
2answers
1k views

Shape-drawing using JavaX Swing

My classmates and I were given an assignment to make a 'Paint' application (similar to Microsoft Paint). There is a color selection JSlider with a connected textbox to each. My code works fine, but ...
1
vote
2answers
1k views

Converting an image to a bitmap

What the code does is convert an image to a bitmap without having to create 3 arrays to make the conversion. It basically uses 1/3rd of the memory that it would normally use. I'm trying to refactor ...
2
votes
1answer
3k views

Random imgur image loader

Just a little thing I made to load 20 random images from imgur. I looked at the way that imgur references images on its site, and I felt like I could probably generate a random string of letters and ...
2
votes
1answer
171 views

Makefile for automatically processing image files

I have a Makefile that is used to automatically process some image files. The basic idea behind this is copy everything from col-noborder and ...
2
votes
1answer
120 views

Writing my own jQuery plugin

I am trying to write a jQuery Plugin from a piece of JS code I had written. What this plugin does is it converts a select box into a map of Australia where I can select individual states. It's ...
5
votes
1answer
613 views

Handling rotations in iOS painting app

I have an iOS app that support all orientations. I sometime notices performance issues when I rotate the device, and sometimes it crashes, badly. And it's not as smooth as other apps. This is my first ...
3
votes
2answers
5k views

Saving and uploading images in a database

I am working on a small method that saves uploaded images and records the images in a database. ...
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 ...
1
vote
1answer
1k views

PHP ImageMagick Image Processing Class

I've written an image processing library for downscaling, sharpening, compressing and caching images using PHP and ImageMagick. Having recently been a chef in the kitchen of procedural and vague ...
5
votes
1answer
965 views

Image upload script for adding items to a database

I wrote my first simple image upload script that allows users to add items to a database along with pictures of said item. My script takes the images uploaded via a form, processes and resizes them ...
2
votes
1answer
1k views

How can I enhance my jigsaw puzzle solver function?

I'm working on writing code which gets several pieces of an image, and reconstructs them to one whole picture. The images are represented by matrices, and two pieces should be "glued" if the right ...
2
votes
1answer
3k views

Image-resizing methods

I took a little heat on a method I had to resize an image and I'm hoping I can get a little help on the best way to do it. This is intended for a simple Java Helper Library I'm developing. I have a ...
3
votes
2answers
2k views

Extracting Pixels From Image Byte[]

I have a requirement where I need to extract pixels of a given rectangle within an image byte[]. More specifically I have an image where I have narrowed an area ...
2
votes
2answers
2k views

Class for loading and resizing images on the fly performs slowly on large images

I made this PHP class that loads any image you specify and resizes it to any size you want. Features If the size you specify is greater than the original, it will not stretch the image but use ...
0
votes
1answer
414 views

Recording timeback seconds of video based on compared pixels from an image

The code reads from the screen, compares a pixel in a previously provided sample image and, if the pixels match, it records timeback seconds of video leading up to it. The output is put into a folder '...
10
votes
3answers
225 views

Detect optimized

I've been trying to optimize this piece of code: ...
6
votes
1answer
1k views

Bilinear resizing algorithm

I have the next bilinear resizing algorithm, and even though I use fixed point is still quite slow for my requirements. In the past I tried to cache some values in tables but the improvement was of a ...
3
votes
0answers
80 views

Does this go raytracing program follow best practices, and typical project layout?

I'm working through learning Go, so as an exercise, I'm writing a simple raytracer. I'd like general feedback on the code style & architecture. Specific areas of concern: Is the project layout ...
10
votes
2answers
1k views

Image handling class

Let me start by saying that I am very happy with this code. I want to share it with other people because I think they will find it helpful, but I want to make sure I did everything in good form ...
6
votes
1answer
58 views

Directory of Snapshots

I have snapshots (photos) that I load off my camera's memory card, and store in a folder. Sometimes I have videos, and occasionally plain audio too (the camera can record just sound). Additionally, ...
1
vote
2answers
9k views

Validating uploaded images

I have attempted to write a method that checks that images being uploaded are valid. ...
1
vote
3answers
92 views

Image uploader and manager

I have recently started using Ruby and would like to hear your take on the following piece of code. ...
2
votes
1answer
2k views

Comparing two images

I have some code in Go that is attempting to compare two images and determine how different they are. The method is fairly crude, but it is fast enough. Basically it just compares both images pixel by ...
5
votes
1answer
52 views

Loading car photo's

I have been developing a small application for a client which combines two arrays together and then creates a URL and then loads the images on the same page from the given URL. I'd like you to look ...
5
votes
1answer
123 views

Preloading images in JavaScript

I'm working on a little game where you press a button and a new image appears. There's a glitch every time you ask a new image to display and it occurred to me that I should preload the necessary ...
5
votes
1answer
6k views

Utilizing HTML5 Canvas to apply color theme to .png icons

Because we have a mix of both icons for core items and .png icons for custom items, I've developed an easy way to theme them (alter the color) all of them easily that will work across all browsers. ...
6
votes
2answers
328 views

Image processing algorithm

This is code I need to maintain. I'm trying to make this as an example for code gone bad, for C programmers going to C++. Please provide any comment you can. The original code is about 40 pages ...
5
votes
1answer
97 views

How to speed up window leveling (brightness, contrast)?

I have to apply window leveling on Canvas Medical Image (CR). I have to get a pixel array from C# Component.lutArr, which is a lookup table array coming as a C# ...
0
votes
3answers
386 views

Image Carousel in JavaScript

I created a very basic "image projector" that shows the current one and shows the next on clicking into the image. And yeah, it works, but I don't think that's a very elegant way to do it. Any advice ...
1
vote
1answer
205 views

Responsive image solution

I just made this responsive image solution, but I'm not sure if it's the best way to do what I'm trying to achieve. Use cases can be found at http://responsimage.com/. ...
4
votes
1answer
332 views

Security: Scale and cache images

Specification A simple PHP script resizes images on-the-fly. The script is called by the web server's 404 handler to return a scaled version of the original. For example, if the original image is at: ...
3
votes
2answers
667 views

Image loader/writer design (no API, pure C++ on Windows)

I have an image loader, now only for bitmaps. I'm a little confused because I want to split my code to different classes, one for writing a BMP data to a file (WRITER), one for loading BMP data from ...
6
votes
1answer
188 views

Image-downloader/wallpaper setter

I'm making an image-downloading app that sets the image as the device wallpaper. For this I used the class: ImageDownloader.java This class has a function which ...
6
votes
2answers
9k views

Ghost4J PDF to image conversion

The primary goal of this code is to convert a PDF file to images. I also create a directory under C:/Media based on a combination of the PDF name and current date ...
15
votes
1answer
11k views

Rotating greyscale images

For educational purposes I wrote a little piece of code to rotate greyscale images as "low level" as possible, that is, not using any rotate() function, but doing ...
6
votes
1answer
534 views

Optimize YUV channel splitting function

The input pointer *data contains the data that needs to be split into different arrays and put in yuvInput. Each pixel is 32 ...
4
votes
2answers
339 views

Calculating luma of a rect in an image of .yuv format

I'm trying to get the average luma of an area in an YUV image in the Android camera. I have come up with the following code which I think is correct and produces consistent results. ...
12
votes
1answer
5k views

Assigning width and height to specify image dimension using jQuery

After testing my site against GTMetrix, I get warnings on not specifying image dimensions. I am working on a WordPress site. Here is my solution: My first solution was: ...
6
votes
1answer
2k views

Getting list of colours from image in lab format

I need to write a bit of code that will get a list of the RGB colours in an image and then translate them into a NumPy array of lab colours. I have managed to do this, but I would like to learn how I ...
2
votes
1answer
2k views

Game map tiles generation with php

I am working on a browser strategy game as a hobby and came up with a decision to use a tile-based map for the world map. I have several questions so far: I am using double-cache (file and apc) for ...
10
votes
2answers
585 views

Recolour a shape

I am starting with a starting colour, a target colour and a starting position in an image. I want to change every contiguous pixel if it is close to the starting colour. Imagine a stop sign. It has ...
0
votes
2answers
307 views

Screenshot-scaling code

Please review for readability. ...
3
votes
1answer
997 views

Improving rendering performance of 2D Tile Game

I want to see if I can make any improvements to the rendering methods that are currently written. I've noticed when profiling this project that the CPU was allocating a fair percentage of the time ...