필터 지우기
필터 지우기

How to resize jpg image through matlab to EXACT 300kb file size

조회 수: 3 (최근 30일)
hadiqa khan
hadiqa khan 2018년 9월 1일
댓글: Walter Roberson 2018년 9월 1일
i have an image of 297kb but for some reasons i want it to be in exact 300kb for uploading else it will not be uploaded. how do i code from scratch from uploading pic to matlab to rsize it to 300 kb. please help urgent:)

답변 (2개)

ahmed nebli
ahmed nebli 2018년 9월 1일
u can use the function imresize like this link https://www.mathworks.com/help/images/ref/imresize.html but u need to know how many rows and colums are in 300kb

Image Analyst
Image Analyst 2018년 9월 1일
Whether or not you can do this depends on the size of your image, how big the header info is, and if you're using compression or not. I'd recommend you NOT use compression, like used by JPG and PNG formats because those formats will give you variable sizes. You're better off using BMP or TIFF formats, but even then you'll have to figure out how big the header is. So use imresize() to shrink your image until it's just below 300,000 bytes, then you'll have to add some padding to some of the header tags to get it up to exactly 300,000 bytes.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by