UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How do I write a C++ program to read the JPG format picture, square the dots per pixel and output the image?

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

Tutor

The logic of this program includes the size of an image. Assuming the size of an image as 250x250. function img_read( ) { image(i,j)=0; for(i=0;i<=249;i++) { for(j=0;j<=249;j++) { image(i,j) = image(i,j)+25; } } printf("The read image with enhanced contrast is:"ima...
Comments

You probably don’t actually want to do what you are asking how to do. As Jim Clack pointed out in his answer, a JPEG file doesn’t store a raster image, it stores a compressed image as a set of transforms. When you convert this image into a bitmap in memory, that’s a process called rendering. Say...
read more
You probably don’t actually want to do what you are asking how to do. As Jim Clack pointed out in his answer, a JPEG file doesn’t store a raster image, it stores a compressed image as a set of transforms. When you convert this image into a bitmap in memory, that’s a process called rendering. Say I had a JPEG image, and the image was, in theory, “naturally” 400x400 pixels in size. I could render it into a bitmap in memory as a 400x400 image, and that would get me a 400x400 raster image, as a bitmap. And then I take that image, and do as you suggest, to magnify it into an 800x800 image, turning each pixel into a square composed of 4 pixels, at two pixels on a side. You’re going to get a pretty crappy image, and unless your intent is to make the image look as if it were being displayed on an old-time 8-bit computer, like an Atari 2600, or a Commodore 64, or an old game console, such as the original Nintendo/Famicon system, or an old Mattel Intellivision, etc. — you’re going to end up with a pretty terrible image. If, instead, you created an 800x800 canvas (an empty bitmap), and rendered the JPEG into it at that resolution directly — then the math is going to work out in such a way as to make the image look a whole heck of a lot better. The reason for this is that the 2x2 pixel regions won’t all be the same color; instead, what gets rendered into an individual pixel is going to depend on the adjacent information — in other words, it’s going to decompress into different pixel colors, for each of the pixels in the 2x2 region. read less
Comments

Related Questions

Why do we use # in C programming?
In the C programming language, # is used for preprocessor directives. The preprocessor is a program that runs before the compiler and processes special directives that begin with # . These directives allow...
Dhanya
0 0
5
What is a macro, and how do you use it?
A macro is a fragment of code which has been given a name. Whenever the name is used, it is replaced by the contents of the macro. There are two kinds of macros. They differ mostly in what they look...
Sandeep
What is a local block in C programming?
the statements within the braces { } is known as local block
Rakhi
0 0
6
what is the significance of lvalue?
An lvalue (locator value) represents an object that occupies some identifiable location in memory (i.e. has an address).
Abhishek
Why is there no C-- language that simplifies the C language?
Creating C-- to simplify C isn't necessary; evolving languages like Rust, Go, or C++ offer modern alternatives.
Komal
0 0
7

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

C Program-Error Handling
//Header files #include<stdio.h>#include<conio.h>#include<stdlib.h> //Main function void main(){ int dividend=10; int divisor=0; int quotient; //Function for clearing screen clrscr(); ...
S

How do i get best Campus / Off Campus Placement?
Companies are looking for Skilled Freshers. So build your technical skills while doing MCA / BTech / BCA / BSc (IT or CS) into below areas- 1. Strong your programming & debugging skills ...

Everything about printf in C language
What is printf and from where it comes from in C code.? You must have used printf so many times in your Car programs but do you really know everything about printf? Let's see. What is the full form...

C Program-Error Handling[Program Exit Status]
//Header files #include<stdio.h>#include<conio.h>#include<stdlib.h> //Main Function void main(){ int dividend=20; int divisor=5; int quotient; //Function for clearing screen clrscr();...
S

Advantages of C++ Language
Advantages of C++ - C++ is a profoundly convenient dialect and is frequently the dialect of decision for multi-gadget, multi-stage application advancement. - C++ is a protest situated programming dialect...

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more