Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9254977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:36:26+00:00 2026-06-18T11:36:26+00:00

How do i downsample an 8 bit bitmap array of size 20×30 to 10×15

  • 0

How do i downsample an 8 bit bitmap array of size 20×30 to 10×15

original_bitmap_array[20][30] to downsample_array[10][15]

this is the original array which is 1 and 0 representation of character ‘A’

00000000111100000000
00000001111100000000
00000001111100000000
00000001111110000000
00000011100110000000
00000011000110000000
00000011000111000000
00000011000011000000
00000111000011000000
00000110000011000000
00000110000011000000
00000110000011000000
00001110000001100000
00001110000001100000
00001100000001100000
00001100000000110000
00001100000000110000
00011111111111110000
00011111111111111000
00011111111111111000
00011111111111111000
00111111111111111000
00110000000000011000
00110000000000011100
01110000000000011100
01110000000000001100
01110000000000001110
01100000000000001110
11100000000000000110
11100000000000000111 

Now can somebody tell how to downsample into 10×15 array, without losing the char ‘A’?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:36:27+00:00Added an answer on June 18, 2026 at 11:36 am

    It all depends on how you want to sample the image.
    One easy sampling for your example is to take every second pixel from the 20×30 and put in 10×15.

    You probably want to expand this and sample at the cross-section of 2×2 pixels and use bi-linear interpolation.

    Because i don’t exactly now how you want to sample the image it is hard for me to give you more information on this.

    Update:

    org_img[20][30]; --monochrome values
    sampled_img[10][15];
    
    for(int i=0; i < 10; i++)
    {
        for(int j=0; j < 15; j++)
        {
            int average = org_img[2*i][2*j] + org_img[2*i+1][2*j]+ org_img[2*i][2*j+1] + org_img[2*i+1][2*j+1];
            average = average>>2; --integer division by 4.
            sampled_img[i][j] = average;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I create a bitmap from bytes coming via the web and when I downsample
Hi I need to downsample a wav audio file's sample rate from 44.1kHz to
I have a Python list with a number of entries, which I need to
I have checked everywhere looking for a solution to this, and have not been
I am trying to upsample an 8000hz, 16-bit wav file to 11025hz in AS3.
I've been having trouble trying to get PIL to nicely downsample images. The goal,
so i'm working with a bunch of 2048x2048 sprite sheets which fill up memory
Is there a built-in way to downsample an image in OpenCV 2.3.1 without prior
Considering that the family of iDevices is expanding, I guess this is a problem
I have two images which I want to compare using python and opencv. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.