First, Pete Souza became an Instagram celebrity by documenting the White House. Then he became an even bigger one by criticizing it.

The former chief White House photographer for President Barack Obama, Mr. Souza has been developing a huge following on his Instagram account since the early days of the Trump administration. That is when he began posting nostalgic photos from the Obama era that, because of their captions and Mr. Souza’s timing, also read as sly commentary on President Trump.

People caught on, and Mr. Souza, who also spent more than five years photographing the Reagan White House, became the subject of numerous media headlines lauding his “shade-throwing” skills. While he declined to comment about Mr. Trump at the time, Mr. Souza kept the visual digs coming. Now he is adapting his strategy into a book titled “Shade: A Tale of Two Presidents.”

The book, scheduled for publication on Oct. 16, is intended to be a “portrait in contrasts,” according to a news release from the book’s publisher, Little, Brown and Company. In it, Mr. Souza’s photography will be juxtaposed with “tweets, headlines, quotes and other material from the first 500 days of the Trump administration.”