Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2020
1,242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.85 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <curses.h>
  3.  
  4. int main()
  5. {
  6.  
  7. int ch,yes=1,no=2;
  8.  
  9. int choice,color;
  10.  
  11. bool repeat = true;
  12.  
  13. char buffer[50];
  14.  
  15. FILE* imageFile;
  16.  
  17. while(repeat)
  18.  
  19. {
  20.  
  21. printf("\n\nBios Dehancer v2.01\n\n");
  22.  
  23. printf("by Emmanuel Tropf ~ EC-design\n\n");
  24.  
  25. printf("###########################################################"
  26.  
  27. "###################################################################"
  28.  
  29. "###################################################################"
  30.  
  31. "###################################################################"
  32.  
  33. );
  34.  
  35. printf("\n\n");
  36.  
  37. printf("1. Load Original Image\n\n"
  38.  
  39. "2. Load Dehanced Image\n\n"
  40.  
  41. "3. Save Dehanced Image\n\n"
  42.  
  43. "4. Exit\n\n");
  44.  
  45. printf("Enter your selection: ");
  46.  
  47. scanf("%d",&choice);
  48.  
  49. switch(choice)
  50.  
  51. {
  52.  
  53. case 1:
  54.  
  55. printf("Enter the name of the image you wish to load: ");
  56.  
  57. fgets(buffer,sizeof(buffer),stdin);
  58.  
  59. gets(buffer);
  60.  
  61. imageFile = fopen(buffer,"r" );
  62.  
  63. break;
  64.  
  65. case 2:
  66.  
  67. printf("Enter the name of the image you wish to save the enhanced version to: ");
  68.  
  69. fgets(buffer,sizeof(buffer),stdin);
  70.  
  71. gets(buffer);
  72.  
  73. imageFile = fopen(buffer,"wb" );
  74.  
  75. break;
  76.  
  77. case 3:
  78.  
  79. fclose(imageFile);
  80.  
  81. printf("Done!\n\n");
  82.  
  83. printf("Press any key to continue...");
  84.  
  85. getch();
  86.  
  87. break;
  88.  
  89. default:
  90.  
  91. printf("Wrong choice.\n\n");
  92.  
  93. printf("Press any key to continue...\n\n");
  94.  
  95. getch();
  96.  
  97. break;
  98.  
  99. }
  100.  
  101. }
  102.  
  103. return 0;
  104.  
  105. }
  106.  
  107. /*
  108. I saved this as "bde.c" and then executed the following to create the executable:
  109.  
  110. gcc -o bde bde.c
  111.  
  112. To run it, just execute "bde". It looks like this:
  113.  
  114. Use the up and down arrow keys to scroll through the images. When you find one that is especially "sucky" (like the image above) enter the number that is displayed in the very upper, right corner of the image. This is the "original".
  115.  
  116. Then, use the right and left arrow keys to scroll through the three different versions of the image. When you find a version that you think is an improvement, enter it's number. This is the starting point for the "Dehanced" version. (You can always go back and try a different "original", but the "Dehanced" version will update with each new "original" you try).
  117.  
  118. Once you have an "original" and a "Dehanced" version that you think looks good, enter "3" to save the new "Dehanced" version with a new name, or "4" to just close this version and keep the original image. Here's an example:
  119.  
  120. And the result...
  121.  
  122. The image on the left is the "original", the image in the middle is the "Dehanced" version, and the image on the right is the "original" with the "Dehanced" version overlayed on it. As you can see, the light areas are much brighter and the dark areas are much darker. Without actually running this through photoshop and comparing side-by-side with the "original", it's very difficult to tell that anything has changed.
  123.  
  124. This also works quite well on whole pictures.
  125. */
  126.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement