Home > Net >  Turn base64 encoded image
Turn base64 encoded image

Time:10-07

On the Internet to find many pictures turn base64 encoded code, and that several code to transform the image after the base64 code size is different, can seek a turn base64 code smaller code!

CodePudding user response:

Others base64:
Data: image/JPG. Base64, R0lGODlhEAAOALMAAOazToeHh0tLS/7 LZV/0 jvb29t/f3//Ub//ge8WSLf RHF/3 kdbw1mxsbp//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcppV0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7

CodePudding user response:

Me:
Data: image/JPG. base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QBaRXhpZgAATU0AKgAAAAgABQMBAAUAAAABAAAASgMDAAEAAAABAAAAAFEQAAEAAAABAQAAAFERAAQAAAABAAAAAFESAAQAAAABAAAAAAAAAAAAAYagAACxj//bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicgIiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAA4AEAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APULPdf2qzRWtu1wEXfcNIUl8wqGJBCNx8w46dsY4p15qOpaOv2y4mSS2iUtLGXDMVyoyuI1wRnvnNUprTWdKmkt7M2TwBgVaVnDfdC84GOiiqt1Z69q0X2SdtPjim/dOys7EAspJAwOfl9e9eLSp4qDSt+P/BOuTpvr+Z//2Q==

CodePudding user response:

You first to save images compressed into Jpg, then recycled into base64 format is small

CodePudding user response:

How big your picture, base64 relative will have how much

CodePudding user response:

Because other people's pictures is the GIF format

CodePudding user response:

In fact, in the end the result depends on the source file
Format compression ratio
Determines the result of the transformation length
Take your list of two picture
Others only 177 bytes
And you have a 871 - byte
The results, of course, be different
And encoding is no compression it
So, from the perspective of the source file is the key to solve the problem

CodePudding user response:

she would play the soy sauce reference 4 floor response: ,
images you are base64 relative will have how much

I turn into JPH format base64, turn out or bigger than the somebody else!

CodePudding user response:

refer to 6th floor f * * KCSDN response:
actually, in the end results depends on the source file
Format compression ratio
Determines the result of the transformation length
Take your list of two picture
Others only 177 bytes
And you have a 871 - byte
The results, of course, be different
And encoding is no compression it
And so the key to solve the problem from the source file is

After others base64 code into his image, save the image, and then I turned the base64, PNG and JPG format I turn, is much larger than others

CodePudding user response:

5/f
reference f * * KCSDN response:
because other people's pictures is the GIF format

I put the image into a GIF, and then go out or bigger than his base64, and very strange, with a picture, I turn on the Internet to find some online base64 url, then there is the number of base64 code that is not the same

CodePudding user response:

I don't know what you are asking, size, and base64 haven't anything to do

CodePudding user response:

references to the tenth floor of orange peel ZZZ reply:
I don't know what you are asking, size and base64 haven't anything to do

I mean, people turn out the length of the base64 than I moved out of the length of the base64 to small!

CodePudding user response:

5/f
reference f * * KCSDN response:
because other people's pictures is the GIF format

+ 1

The picture of the 'others' after decoding, GIF89a file header, is actually the GIF format,
As the picture color, uniform color piece, the GIF format may be better than JPG, files smaller, and it is lossless compression,

CodePudding user response:

This only could be someone else and you're not the same in a jar, theoretically base6 algorithm is the same conversion is the same, unless done before the conversion of compression, such as: compressed into a ZIP first, and then turn to base64

CodePudding user response:

references 9/f, demon elder sister reply:
Quote: refer to fifth floor f * * KCSDN response:
because other people's pictures is the GIF format

I put the image into a GIF, and then go out or bigger than his base64, and very strange, with a picture, I turn on the Internet to find some online base64 url, then there is the number of base64 code that is not the same as

Not you turn this into a GIF you said is a nondestructive transformation without change, such as download artwork, with their own on the drawing save as GIF, got the results

The same file as to what you say different coding results, depending on the coding languages and running system, because different language and system's handling of some characters are different from the commonly used language and system, so will produce differences,
The answer to your question again, make your photos smaller, then you get base64 string will be small,
(advice to know about the base64 encoding mechanism, perhaps you will understand the answer in the comments)

CodePudding user response:

refer to 12 floor github_36000833 reply:
Quote: refer to fifth floor f * * KCSDN response:

Because other people's pictures is the GIF format

+ 1

The picture of the 'others' after decoding, GIF89a file header, is actually the GIF format,
As the picture color, uniform color piece, the GIF format may be better than JPG, files smaller, and it is lossless compression,

Mainly, with a picture, I put him into a GIF, JPG, turn on the site base64, the result turned out, there is not the same, and both is bigger than the original

CodePudding user response:

reference 15 floor demon elder sister reply:
mainly, with a picture, I put him into a GIF, JPG, turn on the site base64, turn out the results are different, and it is better than the original big


Can you use the image tool not as good as others:)
Such as Microsoft's own Paint tools, there is no good to optimize GIF palette,
You give image example of actual only 16 color, and Paint figure drawing board to save the image in the 256 groups of color, make the file is big,

nullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • C#
  • Related