-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small PNGs Getting Skerwed #1
Comments
Hello, |
Hello M. Ansel, Thank you for your swift reply. Late last night, I finally figured it out (I am not an expert at BMP graphics file formats...) . I didn't know about the rule that BMPs have to have a number of bytes per line which is evenly divisible by 4. Since ARGB can only ever be a multiple of 4 bytes, I'd never encountered the problem. The problem was that your result, being 1 byte per px, could cause a row size in bytes which was not divisible by 4. The lack of padding was causing each line to be skewed further. Once I provided the padding bytes, it worked. If I may, I have a suggestion: Since not everyone who uses your excellent product is an expert at the BMP protocol, you might write documentation which warns programmers about the need to pad to a multiple of 4 bytes per line. Alternatively, you could accept widthPx and heightPx as input parameters, and you could perform the padding. In case you would prefer not to do the padding in your code, I would be happy to provide example code for performing the padding for use by others using ColorQuant. TIA, |
M. Ansel,
I am having problems with small PNGs (smaller than about 400x400). The image appears skewed. The smaller the source PNG, the more it gets skewed.
I would greatly appreciate help with this.
TIA,
Lavie
The text was updated successfully, but these errors were encountered: