백왕 아저씨가 맨날 쓰는 페페티콘
일단 이렇게만 해놓고 공부 끝내고 색칠해야지
2016.10.23 C# 버전(GUI) 추가
일베충 + 페페개구리
핵심
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | using System; using System.Drawing; using System.Text; namespace TextArt { public partial class ImageToText { public string[] CharForDrawing = { "#", "#", "@", "%", "=", "+", "*", ":", "-", ".", " " }; public string content; public string Convert(Bitmap image) { Boolean _switch = false; StringBuilder sb = new StringBuilder(); for (int h = 0; h < image.Height; h++) { for (int w = 0; w < image.Width; w++) { Color pixelColor = image.GetPixel(w, h); int red = (pixelColor.R + pixelColor.G + pixelColor.B) / 3; int green = (pixelColor.R + pixelColor.G + pixelColor.B) / 3; int blue = (pixelColor.R + pixelColor.G + pixelColor.B) / 3; Color grayColor = Color.FromArgb(red, green, blue); if (!_switch) { int index = (grayColor.R * 10) / 255; sb.Append(CharForDrawing[index]); } } if (!_switch) { sb.Append("<BR>"); _switch = true; } else { _switch = false; } } return sb.ToString(); } public Bitmap ReSizeImage(Bitmap inputBitmap, int w) // width { int h = 0; // height h = (int)Math.Ceiling((double)inputBitmap.Height * w / inputBitmap.Width); Bitmap result = new Bitmap(w, h); Graphics g = Graphics.FromImage((Image)result); // graphic g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; g.DrawImage(inputBitmap, 0, 0, w, h); g.Dispose(); return result; } } } | cs |
프로젝트 파일
표정 ㅋㅋㅋㅋㅋㅋㅋ 오지네
이런거 해주는 모듈이잇음?
ㄴ C++이라고 도구가 있음
고말고 추가로 일일이 친건아닐거아님
ㄴC++은 알고리즘으로 처리하거나 영상처리 라이브러리 가져다 쓰는게 편함. 근데 C#은 더 편할듯 아예 닷넷에 드로잉 참조가 내장되있어서
흑백존나우울하네...
신기하다 그림을 입력받아서 글자로 출력해주는건가 ㄷㄷ
ㄴ 나는 알고리즘이랑 RGB 구분 영상처리 모듈 활용했음
ㅁㄴㅇㄹ//되있->돼있 (되어 = 돼임) [리듬 맞춤법 봇♬]
밑에 벌레개구리 퀄리티 미쳤다...