A method for decoding a compressed image file comprising symbols encoded as a sequence of variable length prefix-free code-words, the method comprising the steps of: • dividing the encoded sequence into two or more successive initial sub-sequences; • for each initial sub-sequence not comprising the beginning of the encoded sequence, determining a synchronization state for decoding by performing the following steps iteratively: 1. select a set of synchronization states, S, each state being associated with a position in the initial sub-sequence and a synchronization node in a graph of the encoding format information relevant to the initial sub-sequence, S being selected so that it includes at least one synchronization state that would correctly decode the remainder of the initial sub-sequence; 2. if the set of states, S, only contains a single state, use this state as the determined synchronization state and stop the iteration; 3. if the set of states, S, does not contain a single state only, select a state, s, from S, s being associated with the earliest position in S and, starting from the node and the position associated with s, follow the graph of the encoding format information by following bit(s) in the initial sub-sequence until a next synchronization state, ŝ, has been obtained or a next state is recognized as invalid; 4. remove s from S and add ŝ to S if ŝ is a valid state not already in S; and 5. start again from step 2; • partitioning the encoded sequence into successive final sub-sequences where each final sub-sequence not comprising the beginning of the encoded sequence begins at a determined synchronization state; • decoding each final sub-sequence in parallel; and • concatenating the decoded final sub-sequences to obtain a decoded image file. • dividing the encoded sequence into two or more successive initial sub-sequences; • for each initial sub-sequence not comprising the beginning of the encoded sequence, determining a synchronization state for decoding by performing the following steps iteratively: 1. select a set of synchronization states, S, each state being associated with a position in the initial sub-sequence and a synchronization node in a graph of the encoding format information relevant to the initial sub-sequence, S being selected so that it includes at least one synchronization state that would correctly decode the remainder of the initial sub-sequence; 2. if the set of states, S, only contains a single state, use this state as the determined synchronization state and stop the iteration; 3. if the set of states, S, does not contain a single state only, select a state, s, from S, s being associated with the earliest position in S and, starting from the node and the position associated with s, follow the graph of the encoding format information by following bit(s) in the initial sub-sequence until a next synchronization state, ŝ, has been obtained or a next state is recognized as invalid; 4. remove s from S and add ŝ to S if ŝ is a valid state not already in S; and 5. start again from step 2; 1. select a set of synchronization states, S, each state being associated with a position in the initial sub-sequence and a synchronization node in a graph of the encoding format information relevant to the initial sub-sequence, S being selected so that it includes at least one synchronization state that would correctly decode the remainder of the initial sub-sequence; 2. if the set of states, S, only contains a single state, use this state as the determined synchronization state and stop the iteration; 3. if the set of states, S, does not contain a single state only, select a state, s, from S, s being associated with the earliest position in S and, starting from the node and the position associated with s, follow the graph of the encoding format information by following bit(s) in the initial sub-sequence until a next synchronization state, ŝ, has been obtained or a next state is recognized as invalid; 4. remove s from S and add ŝ to S if ŝ is a valid state not already in S; and 5. start again from step 2; • partitioning the encoded sequence into successive final sub-sequences where each final sub-sequence not comprising the beginning of the encoded sequence begins at a determined synchronization state; • decoding each final sub-sequence in parallel; and • concatenating the decoded final sub-sequences to obtain a decoded image file.