Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 40480

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

2 votes

cs50 filter(more comfortable) - Image filters in C

This would eliminate the need to test for pixels that are within the image boundaries. … Every time you feel compelled to add a comment like Make a copy of image, consider factoring the applicable code into a properly named function, e.g. make_copy_of_image(....). …
vnp's user avatar
  • 57.3k
7 votes

Filter: BMP Image Filtering Tool

Consider #define SUPPORTED_BF_TYPE 0x4d42 When allocating an image with RGBTRIPLE(*image)[*width] = calloc(*height, *width * sizeof (RGBTRIPLE)); make up your mind. …
vnp's user avatar
  • 57.3k
8 votes

Mandelbrot image generator

A P3 magic number indicates a plain PPM, which has a serious limitation: No line should be longer than 70 characters. Your code obviously violates it. I recommend to make it into raw PPM (magic …
vnp's user avatar
  • 57.3k
6 votes

Function to get the most frequently appearing pixel

There are numerous problems with the code. First of all, fread never returns EOF (which is -1). The loop should end when it reads less than 3 bytes. Second, max_count is index, not a color value. I p …
vnp's user avatar
  • 57.3k
3 votes

Circuit-Swap mechanism on going (BMP->PPM)

Magic numbers What is the significance of 18, 19, 22 and 23? They must be defined in terms of bitmap file header and bitmap info header Correctness According to a spec, bitmap width and bitmap hei …
vnp's user avatar
  • 57.3k
2 votes

Refactorings on a Win32 Screenshot saving program

Few things surely do not look right. ~CBMPTimer tries to delete an int. Good luck. It also doesn't stop the thread. Having no BMPWriter.h to review I may only suppose what log10 is supposed to do. I …
vnp's user avatar
  • 57.3k
2 votes
Accepted

Slicing and dicing images for Google Play

Use target- and pattern-specific variables: $(ldpi_dir)/btn_%.png : GEOMETRY := 24x $(mdpi_dir)/btn_%.png : GEOMETRY := 36x $(hdpi_dir)/btn_%.png : GEOMETRY := 72x and similar definitions for launc …
vnp's user avatar
  • 57.3k
2 votes

Rapid color replacement for in-memory BMP

Computing rowsize inside bitfox_find_xy (that is, for each and every pixel)seems wasteful: row size never changes during the bitfox_color_replace_data invocation, and shall only be computed once.
vnp's user avatar
  • 57.3k
0 votes

Function to rotate bitmap image

You chose to iterate source pixels. This is a standard mistake leading to loss of quality. The problem is twofold: some source pixel may land on the same destination pixel, and some destination pixels …
vnp's user avatar
  • 57.3k
3 votes
Accepted

BMP writer in C

OTOH allocating the whole image may present a problem if the image is large enough. I recommend to allocate 3 * width + overhead, and reuse it. …
vnp's user avatar
  • 57.3k
4 votes

Read an image with ADNS2610 optical sensor and Arduino Uno

Also, the only sure way to determine that the image is completed is to look at SOF bit. The address setup functionality is shared between ReadRegister and WriteRegister. … While reading image into the static buffer is a technically valid decision, I recommend to read it into the caller provided buffer. …
vnp's user avatar
  • 57.3k
5 votes
Accepted

Image Processing Median Filter in C

defining RGB as typedef struct { unsigned char channel[3]; } RGB; and writing the else clause as for (int color = 0; color < 3; i++) { output[i].channel[color] = median_filter_channel(image
vnp's user avatar
  • 57.3k
7 votes

Rotate an image (2D array) by 90 degrees recursively with low memory usage

First of all, I don't see why do_rotateImageInplace shall be recursive. And indeed, it is a tail recursive, and as such is trivially converted into a loop. Second, the comments are seriously misleadi …
vnp's user avatar
  • 57.3k