How can I use JPEG Compression algorithm for 1D data (e.g. a line)?How can I create an executable JAR with dependencies using Maven?How can I convert a stack trace to a string?quantization of dct image for steganographyJPEG Compression Implementation QuestionsCUDA DCT works only when blockDim.x is 1Steganography using the DCTJPEG compression implementation in MATLABSteganography resistant to JPEG compression and manipulationLSB-DCT based Image steganographyHow are quantized DCT coeffiecients serialised in JPEG?
Music terminology - why are seven letters used to name scale tones
How can I raise concerns with a new DM about XP splitting?
What does the "3am" section means in manpages?
A car is moving at 40 km/h. A fly at 100 km/h, starts from wall towards the car(20 km away)flies to car and back. How many trips can it make?
How to be able to process a large JSON response?
What would you call a finite collection of unordered objects that are not necessarily distinct?
QGIS Geometry Generator Line Type
How do I repair my stair bannister?
Simulating a probability of 1 of 2^N with less than N random bits
Is there a problem with hiding "forgot password" until it's needed?
Can a Gentile theist be saved?
Is camera lens focus an exact point or a range?
My boss asked me to take a one-day class, then signs it up as a day off
What is the term when two people sing in harmony, but they aren't singing the same notes?
You're three for three
A social experiment. What is the worst that can happen?
How to open new tab in existing terminal instead of new terminal instance?
A known event to a history junkie
The most efficient algorithm to find all possible integer pairs which sum to a given integer
Perfect riffle shuffles
Can I use my Chinese passport to enter China after I acquired another citizenship?
Is there a smaller tautogram checker?
Invariance of results when scaling explanatory variables in logistic regression, is there a proof?
Can I rely on these GitHub repository files?
How can I use JPEG Compression algorithm for 1D data (e.g. a line)?
How can I create an executable JAR with dependencies using Maven?How can I convert a stack trace to a string?quantization of dct image for steganographyJPEG Compression Implementation QuestionsCUDA DCT works only when blockDim.x is 1Steganography using the DCTJPEG compression implementation in MATLABSteganography resistant to JPEG compression and manipulationLSB-DCT based Image steganographyHow are quantized DCT coeffiecients serialised in JPEG?
I have a (time series) data that looks like 21,21,22,23,24,23,.... and I'm trying to implement the jpeg algorithm in JAVA to see how the jpeg compression works on such 1D data (my plan is to compare all sorts of compression algorithms).
I know that using JPEG on text data (or in general lossy compression in text data) doesn't make much sense but my goal is to see what kind of intermediate patterns are generated (e.g. "automobile" becomes "qwses")and how much of that intermediate pattern resembles the original words over increasing compression rate. So the idea is something like this: https://www.youtube.com/watch?v=meovx9OqWJc&t=1s
My input file, as I said above, is a 1x458 matrix and contains numbers between 10 and 300; e.g. 10, 13, 14, 14, 15, 12, ...., 247,247,249,.., 284, 283
My main problem is that I am not quite sure how I should theoretically convert the JPEG algorithm (8x8 image multiplied with 8x8 DCT coefficient matrix etc is adapted for a 1xN data (a line) and what part of the implementation should I change in JPEG (e.g. how should I have dct coefficients for such data, etc.)? If someone can explain it with a pseudo code, that would also be really nice.
java compression jpeg dct lossy-compression
New contributor
Chuckster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I have a (time series) data that looks like 21,21,22,23,24,23,.... and I'm trying to implement the jpeg algorithm in JAVA to see how the jpeg compression works on such 1D data (my plan is to compare all sorts of compression algorithms).
I know that using JPEG on text data (or in general lossy compression in text data) doesn't make much sense but my goal is to see what kind of intermediate patterns are generated (e.g. "automobile" becomes "qwses")and how much of that intermediate pattern resembles the original words over increasing compression rate. So the idea is something like this: https://www.youtube.com/watch?v=meovx9OqWJc&t=1s
My input file, as I said above, is a 1x458 matrix and contains numbers between 10 and 300; e.g. 10, 13, 14, 14, 15, 12, ...., 247,247,249,.., 284, 283
My main problem is that I am not quite sure how I should theoretically convert the JPEG algorithm (8x8 image multiplied with 8x8 DCT coefficient matrix etc is adapted for a 1xN data (a line) and what part of the implementation should I change in JPEG (e.g. how should I have dct coefficients for such data, etc.)? If someone can explain it with a pseudo code, that would also be really nice.
java compression jpeg dct lossy-compression
New contributor
Chuckster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
So, it seems that you are really just trying to come up with a new compression algorithm? From what I can tell, JPEG implementations will try and pad images that do not have 8 x 8 (or whatever the block size is) blocks evenly.
– Tyler Nichols
Mar 21 at 15:13
Is it possible to convert 1D -> 2D by stacking up subsets and then splitting them up to get result?
– Tyler Nichols
Mar 21 at 15:17
I am not sure if folding the data after the 8th column (to create blocks that are the power of 8) would affect the accuracy of the compression since the data doesn't have any such property. I was thinking to maybe create 2D version of the data by adding just 0s to create 8 more rows. I guess multiplying with 0s would not particularly effect the performance. Am I making any sense?
– Chuckster
Mar 21 at 15:55
add a comment |
I have a (time series) data that looks like 21,21,22,23,24,23,.... and I'm trying to implement the jpeg algorithm in JAVA to see how the jpeg compression works on such 1D data (my plan is to compare all sorts of compression algorithms).
I know that using JPEG on text data (or in general lossy compression in text data) doesn't make much sense but my goal is to see what kind of intermediate patterns are generated (e.g. "automobile" becomes "qwses")and how much of that intermediate pattern resembles the original words over increasing compression rate. So the idea is something like this: https://www.youtube.com/watch?v=meovx9OqWJc&t=1s
My input file, as I said above, is a 1x458 matrix and contains numbers between 10 and 300; e.g. 10, 13, 14, 14, 15, 12, ...., 247,247,249,.., 284, 283
My main problem is that I am not quite sure how I should theoretically convert the JPEG algorithm (8x8 image multiplied with 8x8 DCT coefficient matrix etc is adapted for a 1xN data (a line) and what part of the implementation should I change in JPEG (e.g. how should I have dct coefficients for such data, etc.)? If someone can explain it with a pseudo code, that would also be really nice.
java compression jpeg dct lossy-compression
New contributor
Chuckster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I have a (time series) data that looks like 21,21,22,23,24,23,.... and I'm trying to implement the jpeg algorithm in JAVA to see how the jpeg compression works on such 1D data (my plan is to compare all sorts of compression algorithms).
I know that using JPEG on text data (or in general lossy compression in text data) doesn't make much sense but my goal is to see what kind of intermediate patterns are generated (e.g. "automobile" becomes "qwses")and how much of that intermediate pattern resembles the original words over increasing compression rate. So the idea is something like this: https://www.youtube.com/watch?v=meovx9OqWJc&t=1s
My input file, as I said above, is a 1x458 matrix and contains numbers between 10 and 300; e.g. 10, 13, 14, 14, 15, 12, ...., 247,247,249,.., 284, 283
My main problem is that I am not quite sure how I should theoretically convert the JPEG algorithm (8x8 image multiplied with 8x8 DCT coefficient matrix etc is adapted for a 1xN data (a line) and what part of the implementation should I change in JPEG (e.g. how should I have dct coefficients for such data, etc.)? If someone can explain it with a pseudo code, that would also be really nice.
java compression jpeg dct lossy-compression
java compression jpeg dct lossy-compression
New contributor
Chuckster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Chuckster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Mar 21 at 16:28
static_cast
1,07211521
1,07211521
New contributor
Chuckster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Mar 21 at 14:41
ChucksterChuckster
12
12
New contributor
Chuckster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Chuckster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Chuckster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
So, it seems that you are really just trying to come up with a new compression algorithm? From what I can tell, JPEG implementations will try and pad images that do not have 8 x 8 (or whatever the block size is) blocks evenly.
– Tyler Nichols
Mar 21 at 15:13
Is it possible to convert 1D -> 2D by stacking up subsets and then splitting them up to get result?
– Tyler Nichols
Mar 21 at 15:17
I am not sure if folding the data after the 8th column (to create blocks that are the power of 8) would affect the accuracy of the compression since the data doesn't have any such property. I was thinking to maybe create 2D version of the data by adding just 0s to create 8 more rows. I guess multiplying with 0s would not particularly effect the performance. Am I making any sense?
– Chuckster
Mar 21 at 15:55
add a comment |
So, it seems that you are really just trying to come up with a new compression algorithm? From what I can tell, JPEG implementations will try and pad images that do not have 8 x 8 (or whatever the block size is) blocks evenly.
– Tyler Nichols
Mar 21 at 15:13
Is it possible to convert 1D -> 2D by stacking up subsets and then splitting them up to get result?
– Tyler Nichols
Mar 21 at 15:17
I am not sure if folding the data after the 8th column (to create blocks that are the power of 8) would affect the accuracy of the compression since the data doesn't have any such property. I was thinking to maybe create 2D version of the data by adding just 0s to create 8 more rows. I guess multiplying with 0s would not particularly effect the performance. Am I making any sense?
– Chuckster
Mar 21 at 15:55
So, it seems that you are really just trying to come up with a new compression algorithm? From what I can tell, JPEG implementations will try and pad images that do not have 8 x 8 (or whatever the block size is) blocks evenly.
– Tyler Nichols
Mar 21 at 15:13
So, it seems that you are really just trying to come up with a new compression algorithm? From what I can tell, JPEG implementations will try and pad images that do not have 8 x 8 (or whatever the block size is) blocks evenly.
– Tyler Nichols
Mar 21 at 15:13
Is it possible to convert 1D -> 2D by stacking up subsets and then splitting them up to get result?
– Tyler Nichols
Mar 21 at 15:17
Is it possible to convert 1D -> 2D by stacking up subsets and then splitting them up to get result?
– Tyler Nichols
Mar 21 at 15:17
I am not sure if folding the data after the 8th column (to create blocks that are the power of 8) would affect the accuracy of the compression since the data doesn't have any such property. I was thinking to maybe create 2D version of the data by adding just 0s to create 8 more rows. I guess multiplying with 0s would not particularly effect the performance. Am I making any sense?
– Chuckster
Mar 21 at 15:55
I am not sure if folding the data after the 8th column (to create blocks that are the power of 8) would affect the accuracy of the compression since the data doesn't have any such property. I was thinking to maybe create 2D version of the data by adding just 0s to create 8 more rows. I guess multiplying with 0s would not particularly effect the performance. Am I making any sense?
– Chuckster
Mar 21 at 15:55
add a comment |
1 Answer
1
active
oldest
votes
You'd need to provide more information about the nature of your 1D data, and why you think it is compressible. What patterns are you expecting to see?
For example, if it really looks like the sequence you show (21,21,22,23,24,23), then a simple model using the difference of successive values would result in data that is highly compressible by a standard lossless compressors like gzip. E.g. (21,0,1,1,1,-1).
To take advantage of higher-order correlations, what you might be looking for is an FFT. You can do an FFT efficiently on any sequence of 2n samples (not only eight samples, as the JPEG DCT does). There are libraries out there that do lossless integer FFTs, as well as other transforms like wavelets, that you can try.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Chuckster is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55283009%2fhow-can-i-use-jpeg-compression-algorithm-for-1d-data-e-g-a-line%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You'd need to provide more information about the nature of your 1D data, and why you think it is compressible. What patterns are you expecting to see?
For example, if it really looks like the sequence you show (21,21,22,23,24,23), then a simple model using the difference of successive values would result in data that is highly compressible by a standard lossless compressors like gzip. E.g. (21,0,1,1,1,-1).
To take advantage of higher-order correlations, what you might be looking for is an FFT. You can do an FFT efficiently on any sequence of 2n samples (not only eight samples, as the JPEG DCT does). There are libraries out there that do lossless integer FFTs, as well as other transforms like wavelets, that you can try.
add a comment |
You'd need to provide more information about the nature of your 1D data, and why you think it is compressible. What patterns are you expecting to see?
For example, if it really looks like the sequence you show (21,21,22,23,24,23), then a simple model using the difference of successive values would result in data that is highly compressible by a standard lossless compressors like gzip. E.g. (21,0,1,1,1,-1).
To take advantage of higher-order correlations, what you might be looking for is an FFT. You can do an FFT efficiently on any sequence of 2n samples (not only eight samples, as the JPEG DCT does). There are libraries out there that do lossless integer FFTs, as well as other transforms like wavelets, that you can try.
add a comment |
You'd need to provide more information about the nature of your 1D data, and why you think it is compressible. What patterns are you expecting to see?
For example, if it really looks like the sequence you show (21,21,22,23,24,23), then a simple model using the difference of successive values would result in data that is highly compressible by a standard lossless compressors like gzip. E.g. (21,0,1,1,1,-1).
To take advantage of higher-order correlations, what you might be looking for is an FFT. You can do an FFT efficiently on any sequence of 2n samples (not only eight samples, as the JPEG DCT does). There are libraries out there that do lossless integer FFTs, as well as other transforms like wavelets, that you can try.
You'd need to provide more information about the nature of your 1D data, and why you think it is compressible. What patterns are you expecting to see?
For example, if it really looks like the sequence you show (21,21,22,23,24,23), then a simple model using the difference of successive values would result in data that is highly compressible by a standard lossless compressors like gzip. E.g. (21,0,1,1,1,-1).
To take advantage of higher-order correlations, what you might be looking for is an FFT. You can do an FFT efficiently on any sequence of 2n samples (not only eight samples, as the JPEG DCT does). There are libraries out there that do lossless integer FFTs, as well as other transforms like wavelets, that you can try.
answered Mar 21 at 23:49
Mark AdlerMark Adler
59.5k867112
59.5k867112
add a comment |
add a comment |
Chuckster is a new contributor. Be nice, and check out our Code of Conduct.
Chuckster is a new contributor. Be nice, and check out our Code of Conduct.
Chuckster is a new contributor. Be nice, and check out our Code of Conduct.
Chuckster is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55283009%2fhow-can-i-use-jpeg-compression-algorithm-for-1d-data-e-g-a-line%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
So, it seems that you are really just trying to come up with a new compression algorithm? From what I can tell, JPEG implementations will try and pad images that do not have 8 x 8 (or whatever the block size is) blocks evenly.
– Tyler Nichols
Mar 21 at 15:13
Is it possible to convert 1D -> 2D by stacking up subsets and then splitting them up to get result?
– Tyler Nichols
Mar 21 at 15:17
I am not sure if folding the data after the 8th column (to create blocks that are the power of 8) would affect the accuracy of the compression since the data doesn't have any such property. I was thinking to maybe create 2D version of the data by adding just 0s to create 8 more rows. I guess multiplying with 0s would not particularly effect the performance. Am I making any sense?
– Chuckster
Mar 21 at 15:55