Create new pgm file to hold changed image

Assignment Help Computer Graphics
Reference no: EM131065000

1. Read three command-line arguments, the first is the image we wish to hide a file in, the second is the filename of the file we wish to hide, the third is the filename that we will write the hidden image to.

2. copy the original image to an array

3. create new pgm file to hold changed image

4. allocate memory for the new image data

5. start at the mask image's 0,0 pixel

6. for each bit in the hidden file

a. drop the least significant bit from the mask image current pixel value

b. add a 1 to that pixel value if the corresponding hidden file bit is a 1

c. add a 0 (or don't) to that pixel value if the corresponding hidden file bit should be a 0

d. move to the next pixel in the image (the next column in the image, or the next row's 0th column if at the max column has been reached)

7. write an EOF character in the next 8 image pixels

8. save the array to a file using the pgm image format we've been using for the prior projects

Your goal (for the decode portion): to write a program that will:

1. read two command-line arguments; take the first command-line argument which is the filename of an image (we will provide two pgm images to test with)

2. read that image from the provided filename to an array

3. open the decoded file with the second command-line argument as the filename

4. for each pixel in the image

a. if the last bit is zero

i. make the next corresponding bit in the hidden file a 0

b. if the last bit is one

i. make the next corresponding bit in the hidden file a 1

5. write each decoded byte to the decoded file

Reference no: EM131065000

Questions Cloud

Calculate its moment of inertia i2 with respect to axis 2-2 : The moment of inertia with respect to axis 1-1 of the scalene triangle shown in the figure is 90 ×103 mm4. Calculate its moment of inertia I2 with respect to axis 2-2.
Discuss how healthcare organizations are financed : Discuss how healthcare organizations are financed. There are two means of acquiring capital for healthcare business: debt capital or equity. Describe the features of both. Finally indicate how businesses determine and interpret the corporate cost of ..
Determine the polar moment of inertia ip of an isosceles : Determine the polar moment of inertia IP of an isosceles triangle of base b and altitude h with respect to its apex (see Case 5, Appendix D).
Limiting resource managers often seek to produce : Question 2  When constrained by a limiting resource, managers often seek to produce those products which have:
Create new pgm file to hold changed image : Read three command-line arguments, the first is the image we wish to hide a file in, the second is the filename of the file we wish to hide, the third is the filename that we will write the hidden image to. copy the original image to an array and c..
Determine the moment of inertia ic with respect to an axis : One quarter of a square of side a is removed (see figure). What are the coordinates and of the centroid C of the remaining area?
What purpose of sequence diagrams and communication diagrams : What size do you think a project needs to be in order to require project management? Discuss this question for project management in general and for each of the project-planning activities. Consider the various "size" factors of a project, such as..
Doug custom construction company : Exercise 26-2 Doug's Custom Construction Company is considering three new prodects, each reguiring an equipument investment of $25.080. each project will last for 3 year and produce the following net annual cash flows.
Calculate the expected and the actual capital gains yield : Calculate the Expected and the Actual Capital Gains Yield (CGY), the Current (Coupon) Yield (CY), and the Total Yield (TY) for each security during 2013 and 2014. Also find the present Yield-to-Maturity for each security.

Reviews

Write a Review

Computer Graphics Questions & Answers

  Enhance the buttonviewer program so that it prints the time

Enhance the ButtonViewer program so that it prints the time at which the button was clicked.

  Flaw in your design and outline

After completing Part a, discuss the flaw in your design and outline some code that will cause it to break (your code should compile fine and will also execute without an error but will violate how a rectangle or square should behave).

  Describe the tiff and jpeg bitmap graphic formats

Describe the TIFF and JPEG bitmap graphic formats

  A user interface

Which of the following is NOT a user interface?A. command driven B. graphical user interface (GUI) C.application programming interface (API) D. menu-driven

  Ljfkdjfk sdkfj ksdjkfjsdk j sd fldsl klsdl lsdlfkldsk

sd fldsl klsdl lsdlfkldsk lksldkflksdlfklksdl lsdklf l sd fldsl klsdl lsdlfkldsk lksldkflksdlfklksdl lsdklf l sd fldsl

  Among the alternative rationales that are set out for

among the alternative rationales that are set out for cooperative strategy on the business level the most effective in

  Bundled attribute what is bundled attribute types of

what is bundled attribute ? ltbrgttypes of bundled attribute? ltbrgtexplain abount over all bundled atttribute?

  What is the difference between animation and transition

What is the difference between animation and transition as it relates to a PowerPoint presentation? Review the different handout page formats.

  It security report and presentation

The presentation must include appropriate graphics, and may be in a Microsoft PowerPoint presentation format.Online students will submit a presentation that must include detailed speaker notes.

  Create a colorised shaded relief map overlaid

The Census gives a comprehensive picture of the social and living conditions of the population in 2011. It provides detail to the smallest area and the results are an essential tool for effective policy, planning and decision making purposes.

  Relative positioning and interactive positioning

Relative Positioning and Interactive Positioning by Dragging and Clicking and some Simple Animation

  Website template design

Recognize a few sites that appear to be designed using either a template or style sheet. What types of documents lend themselves easily to templates?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd