Find Jobs
Hire Freelancers

PHP convert Image to RGB565, compress, show stat's and download

$30-250 USD

종료됨
게시됨 약 5년 전

$30-250 USD

제출할때 지불됩니다
I am working on logic for a Microcontroller that dynamically updates a screen via UART. The screen only accepts vector based commands to fill a coordinate with a square and a filled color. The command looks like so fill x,y,h,w,<color> The PHP code I wrote so far takes the image and converts each pixel to the following format, However, there are tons of room for optimization. An idea I had was to take the image and find the most common color then set the whole screen to this color. Then find all pixel's within a given shade and make it the same color than that beings the fill command to a single command because it can then cover two squares by using the command x,y,2,1,<color>. The goal is to generate the picture with lossy compression but without extremely affecting the image and as few FILL commands as possible. During the development of these algorithms, your PHP code will need to display the before and after image and the number of FILL lines required to draw the image. The Binary data of the x,y, color will then be sent as a .bin file when requested from the .php script. It can be your own or someone else's algorithm.. just make it possible to redraw with least amount of commands Examples of algorithms are like this. Cycle through each pixel and neighboring pixels and if they are similar shade make them the same. Then find the most common color and set the background image to that color. then cycle through each pixel if it's not that background color fill in that color. The least amount of times you have to cast the fill command to drop a pixel the better the algorithm! A sample image that will be used is here [login to view URL] In this case, the large portion of the map is gray, so its best to make that shade one distinct RGB565 color then set the image of the full background to that color using a single fill command. Then cycle through each pixel and combine additional like colors to make the least amount of permutations to cast a fill command to fill a pixel or a subset of pixels. When doing this without any compression you would have to cast nearly one fill command for each pixel and would take over 5 minutes to draw a screen which is not a doable solution however there should be a simple way to go upon this. Sample PHP code to get started. <?php $img = imagecreatefromjpeg("Path to Image that is 480x272"); $width = ImageSX($img); $height = ImageSY($img); for ($y = 0; $y < $height; $y++) { for ($x = 0; $x < $width; $x++) { $c = imageColorAt($img, $x, $y); $r = ($c >> 16) & 0xFF; $g = ($c >> 8) & 0xFF; $b = $c & 0xFF; $r = $r >> 3; $g = $g >> 2; $b = $b >> 3; $oc = ($r << 11) | ($g << 5) | $b; echo ("fill $x,$y,1,1,$oc<br>"); } } ?>
프로젝트 ID: 19339774

프로젝트 정보

5 제안서
원격근무 프로젝트
활동 중 5년 전

돈을 좀 벌 생각이십니까?

프리랜서 입찰의 이점

예산 및 기간 설정
작업 결과에 대한 급여 수급
제안의 개요를 자세히 쓰세요
무료로 프로젝트에 신청하고 입찰할 수 있습니다

고객에 대한 정보

국기 (UNITED STATES)
Palm Desert, United States
5.0
6
결제 수단 확인
12월 28, 2004부터 회원입니다

고객 확인

감사합니다! 무료 크레딧을 신청할 수 있는 링크를 이메일로 보내드렸습니다.
이메일을 보내는 동안 문제가 발생했습니다. 다시 시도해 주세요.
등록 사용자 전체 등록 건수(일자리)
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
미리 보기 화면을 준비 중...
위치 정보 관련 접근권이 허용되었습니다.
고객님의 로그인 세션이 만료되어, 자동으로 로그아웃 처리가 되었습니다. 다시 로그인하여 주십시오.